Тёмный

Subsurface Scattering for Foliage, in Unity (WITHOUT RAYTRACING!) 

PuckLovesGames
Подписаться 2,6 тыс.
Просмотров 46 тыс.
50% 1

Making a Subsurface Scattering Foliage Shader in Unity, without using Raytracing.
You can read a more detailed write-up of this approach here:
/ subsurface-write-20905461
If you'd like access to the source files (shaders and Unity Project) that you can freely use in your own games, please consider supporting me on PATREON - / pucklovesgames
Keep up to date by following me on TWITTER - / ed_dv
-----------------------------------------------------
This shader is based on a great article by Alan Zucconi detailing a fast approach to Subsurface Scattering in Unity - www.alanzuccon...
A great guide on preparing foliage meshes is on the Polycount wiki - wiki.polycount....
-----------------------------------------------------

Опубликовано:

 

22 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 72   
@MirkoCrafter
@MirkoCrafter 5 лет назад
I undestood absolutely nothing. Impressive! :D
@YadroGames
@YadroGames 3 года назад
me too
@ManSpidernater
@ManSpidernater 6 месяцев назад
I've been thinking about implementing this for a while and here it all is, super straightforward and easy to follow, that's mint
@Overflowsweden
@Overflowsweden 5 лет назад
Great video! Would love to see this in shader graph.
@werti4894
@werti4894 4 года назад
thanks for the tutorial!!!!!! Finding amplify tutorials is the best, they're far and few in between but always high quality
@aceparable1
@aceparable1 10 месяцев назад
Thank you for this!
@SnutiHQ
@SnutiHQ 4 года назад
This is awesome, will have to try this out in Shader Graph! 😍🌳
@bryantenorio368
@bryantenorio368 4 года назад
How did that go? I can't find a node for "World space light direction"
@SnutiHQ
@SnutiHQ 4 года назад
@@bryantenorio368 Hard to get lighting data in shader graph I've noticed as well, so not sure! We tried a programmatic approach, and made a tutorial on that a while back (for Toon shader), similar principle could work, but there are other approaches using custom nodes I know.
@TrentSterling
@TrentSterling 6 лет назад
Freakin fantastic! Love the tip about the surface normals pointing out!
@lauch8844
@lauch8844 5 лет назад
Thanks alot! I also reallly like the Blog posts you show us to learn even more! Great work
@threemoo
@threemoo 5 лет назад
So quick, and gave me all the information I need.
@reaktorleak89
@reaktorleak89 3 года назад
Wow, this is a life saver of a tutorial.
@KRGraphicsCG
@KRGraphicsCG 4 года назад
Now this is VERY purty
@thecrazy8888
@thecrazy8888 2 года назад
Thank you for the SSS tutorial. I hope you make the wind tutorial one day.
@sanketvaria9734
@sanketvaria9734 3 года назад
Actually I went one step further with this method and created SSS effect around the surface which are parallel to light giving a light bleeding effect
@baronlovat5200
@baronlovat5200 5 лет назад
Can't quite seem to get it to work with the standard Unity Shader Graph, but it was a good attempt, cheers.
@toureiro
@toureiro 6 лет назад
This was fantastic.
@salgueiro1575
@salgueiro1575 6 лет назад
Awesome stuff dude!
@zigastrmsek2
@zigastrmsek2 5 лет назад
Half of these nodes are missing in my shader graph wtf?
@unrealdevop
@unrealdevop 3 года назад
Yeah, Unity is too lazy to improve on their shader graph so they decided to let the community do it and charge $100 for it. Wish Unity could be more Dev friendly like the Unreal Engine, it's one of the biggest things I hate the most about Unity. It's a good tool, but I can't afford to spend $100 on it. Seems some of the best sharers use it too and I think these guy's do this so that you'll be more inclined to send the money on Patreon.....Knowing it's cheaper then laying down $100 on a tool, when I see these video's I automatically give a thumbs down and Unsubscribe from their channel.
@BillyJackman3D
@BillyJackman3D 2 года назад
How would you get the "custom lighting" slot in the built in Shader Graph? i got the rest working while plugged into the emission channel but i would like the custom lighting slot that you are using here. Thanks for the great tutorial by the way!
@cyuxi
@cyuxi 5 лет назад
Very informative ! ! Thanks!
@nicolasduboc3936
@nicolasduboc3936 6 лет назад
Thanks a lot for this great tutorial ! Very well explained and very interesting ! =D
@PuckLovesGames
@PuckLovesGames 6 лет назад
Thank you so much for watching! Let me know if there are any topics in particular you'd like covered in the future.
@nicolasduboc3936
@nicolasduboc3936 6 лет назад
I'm always very interested in shaders with "movement" implied like foliage, water, liquid, clouds and shaders for lighting solutions like fake lighting with sprites, fake volumetric lighting... It's also very cool to see how different approaches (yours vs other tech artists) can have a similar result !
@danielgriffin4624
@danielgriffin4624 4 года назад
Brilliant, cheers :)
@e-frame5344
@e-frame5344 5 лет назад
Really nice tutorial. Thanks a lot :)
@ItIsNathan3D
@ItIsNathan3D 5 лет назад
This was fire. Subbed and BELL RANG.
@kaptnseebar9467
@kaptnseebar9467 4 года назад
I know why I'm subscribed to you
@Atrix256
@Atrix256 6 лет назад
Very cool video
@yahjungcuppp
@yahjungcuppp 5 лет назад
Awesome!!!!
@remon563
@remon563 3 года назад
this works well in Unreal 4 as well for those interested ;) Check out Ben Cloward's Foliage AO tutorial !
@Yoctopory
@Yoctopory 2 года назад
After two hours of trying to get this to work - I now assume it just doesn't work in URP because there is no "custom lighting", correct?
@Leonardorth.
@Leonardorth. 5 лет назад
Would be interesting to see how this translates to Shader Graph in Unity 2019
@bluekiwiconsuming4568
@bluekiwiconsuming4568 5 лет назад
exactly.
@LaikaBossGames
@LaikaBossGames 5 лет назад
same
@akamarudesign7412
@akamarudesign7412 4 года назад
i am currently on that... it's beenn 2 weeks now
@janusztarczykowski9003
@janusztarczykowski9003 4 года назад
Shader Graph and whole rendering pipeline shenanigans are not gonna be production ready for quite some time, best to use ASE tbh ;) I'd rather see this translated to code than SG
@zackblack2630
@zackblack2630 2 года назад
How do you do this in URP? There's no Custom Lighting output!
@sanketvaria9734
@sanketvaria9734 3 года назад
What is the view direction? explain this and also do tell what is it named in shader graph in URP
@tobyfredson5668
@tobyfredson5668 2 года назад
Any way to make this work with point lights without custom light mode?
@DeadpoolWadeWilson
@DeadpoolWadeWilson Год назад
And what if you want to do a skin shader? I can't use specular with this method..
@Legionope
@Legionope 5 месяцев назад
You can if you write your own custom one.
@decsec1660
@decsec1660 5 лет назад
Is it compatible with Speedtree Unity?
@loneshadow-studio
@loneshadow-studio 4 года назад
I'm curious, its there a particular reason why you didn't just use the translucency option built into the node?
@hellothere_1257
@hellothere_1257 4 года назад
Because translucency would only allow light to shine through from directly behind the object. However, subsurface scatter, as the name implies, scatters the light, so it lights even when the light comes at an angle. Also, you're not supposed to see the actual geometry behind the object, only bright lights.
@loneshadow-studio
@loneshadow-studio 4 года назад
@@hellothere_1257 Yeah I ended up figuring that all out after finally being forced to create my own shaders.
@KirillBreuss
@KirillBreuss 2 года назад
How to do it without Amplify? In built-in to unity Shader Graph?
@DeadpoolWadeWilson
@DeadpoolWadeWilson Год назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-xHD7Q36-Dao.html your answer
@TheFireNoodle
@TheFireNoodle 5 лет назад
how do I animate the leaves? like you said in the video?
@DoubleBob
@DoubleBob 3 года назад
Is it possible to use the shader you've made in Amplify, when I don't have Amplify? Can I still change parameters without Amplify?
@janusztarczykowski9003
@janusztarczykowski9003 4 года назад
Great tutorial, although a bit slower and more in depth look would be appreciated, there was a lot of stuff going on and a lot of knowledge in just 5 minutes!
@zankaster3935
@zankaster3935 5 лет назад
A couple days ago I followed the article by Alan Zucconi to build a translucent shader, something was not right but I thought it was my fault and I messed up some calculation. But now I see in your render the same problem: when the light direction is the same as the view (camera) direction, shouldn't the leaves be brighter than when the light source is behind them? In other words, when you move the light behind the camera in the example, shouldn't the leaves be more illuminated? That's what would happen in real world
@PuckLovesGames
@PuckLovesGames 5 лет назад
Actually, depending on the material, that doesn't have to be the case (if I understand you correctly). You can get often much more illumination when the light is shining through a material than when it's reflecting off it, particularly with foliage. I had this lovely potplant with thin leaves once, and when the light was behind it, it glowed like it was on fire. So pretty. But regardless of that, this isn't a properly calculated physically accurate effect anyway, it's a super fake hacky way to approximate it. You can absolutely tweak the values to make the direct lighting stronger or weaker than the subsurface lighting with multipliers. Just go with what looks right to you.
@elzar8763
@elzar8763 4 года назад
i like it
@everlastingmedia
@everlastingmedia Год назад
What's the trick to make this work with HDRP? Doesn't have the custom lighting input.
@mradinoz
@mradinoz 3 года назад
it would be nice to see how you made the shadows aswell :' (((
@MichelHabib
@MichelHabib 5 лет назад
this is super great, i tried it and it rocks. Can you suggest a simple way to add little transparency to the translucent edges? would that be possible? I kinda understand the custom lighting is blocking most of the other inputs in the output node
@eggheart
@eggheart 5 лет назад
If the opacity nodes are blocked off (depending on your setup), you can still get transparency by using a Grab Screen Colour, and blending that in with the SSS mask, however, this will also require the shader to be in the transparent render queue (rendered after all the opaque objects) which changes the shading and drops shadow support. Another way that maintains the benefits of being a properly lit opaque shader, is to use Dither to do transparency. It makes lots of little dots, in different patterns to fake transparency - it's not true transparency, as pixels are either completely opaque or transparent so it creates a noisy effect, but with the right AA it can look pretty good. If you use Dither, I recommend finding a 'blue noise' tilable texture, rather than using the build in Dither patterns. I'm a big fan of dither - when you first see it you'll probably be disappointed that it doesn't look as smooth as real transparency, but I think players are pretty forgiving, and I think it's worth it for the benefits of avoiding the transparent render queue.
@onewayroad3765
@onewayroad3765 3 года назад
Can rim light achieve same effect as subsurface scattering
@Legionope
@Legionope 5 месяцев назад
The two are unrelated to eachother. Rim light emulates a reflective surface by using fresnel to make geometry pop around the edges. This SSS actually let's light sources shine through the geometry. If you combine this effect with fresnel however, you get a really nice result.
@perryjones7655
@perryjones7655 3 года назад
This is exactly what I'm looking for, but I'm using UE4! haha. I hope I can figure out the equivalent nodes in UE4.
@zhuqiqin
@zhuqiqin 5 лет назад
I want to know how it work with normalmap?
@ranveerkumar3123
@ranveerkumar3123 5 лет назад
how to on or bring "costume light" input in masternode?
@PuckLovesGames
@PuckLovesGames 5 лет назад
You have to change the Light Model from Standard to Custom Lighting to enable the custom lighting input.
@Aethelvlad
@Aethelvlad 2 года назад
sss never uses ray tracing, ray tracing is the third bounce of a light being calculated. sss is the first ray passing through.
@RobbyDR
@RobbyDR 5 лет назад
May I ask about the setup of the nodes "Basic Standard Lighting NdotL + Indirect" which is attached to the relay node that then plugs into the "add node" and finally to the Custom Lighting?
@PuckLovesGames
@PuckLovesGames 5 лет назад
Hi there! When you're using custom lighting, you have to calculate all that stuff yourself. Amplify Shader Editor comes with a Blinn-Phong Light node, which does that for you (you can see this setup at 2.34 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-RPkhbjmmvS0.html), but if you wanted to do it yourself, a simple starting point is NdotL, which is the the Dot Product of the Normal Direction and the Light Direction (clamped 0-1 usually), which gives you basic light information. You can see an example of that node setup here: wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/World_Space_Light_Dir I hope that helps! Let me know if anything else doesn't make sense and I'm happy to talk you through it.
@ilyasdev8962
@ilyasdev8962 2 года назад
wich pipeline??????????????????????????????????????????????????????????????????????????????????????
@elrymoe
@elrymoe 2 года назад
Looks like ass since its illuminating the wrong side aswell. But nice try
@LeonelAmaral14
@LeonelAmaral14 3 года назад
Anyone knows how to do this with shader graph?
Далее
Toon Fire shader in Unity
4:13
Просмотров 23 тыс.
«По каверочку» х МУЗЛОФТ❤️
00:21
Распаковка iPhone 16 Pro Max
01:01
Просмотров 2,2 млн
The biggest lie in video games
15:18
Просмотров 1,9 млн
The 4 main types of subsurface scattering
10:58
Просмотров 58 тыс.
Coding Adventure: Clouds
12:50
Просмотров 1,2 млн
Coding Adventure: Portals
16:06
Просмотров 1,3 млн
Side-effects of doing VERY long runs in Noita
10:24
Просмотров 122 тыс.
why do video game trees look so bad?
4:51
Просмотров 166 тыс.
Animated Candle Flame Shader, in Unity
5:00
Просмотров 21 тыс.
Cel Shading - Devlog 3
11:09
Просмотров 46 тыс.
«По каверочку» х МУЗЛОФТ❤️
00:21