Screen Space Ambient Occlusion - Custom Lighting Models - Episode 9
www.youtube.com
In this shader tutorial, I show how to write the code required to bring screen space ambient occlusion into our custom lighting model in Unity. Once available we can use it in the traditional way to darken the ambient - but we can also use it in other, unique ways to get just the look we're looking for.Here's the code for the Custom Function node: #if defined(_SCREEN_SPACE_OCCLUSION) && !defined(_SURFACE_TYPE_TRANSPARENT) && !defined(SHADERGRAPH_PREVIEW) float ssao = saturate(SampleAmbientOcclusion(ScreenPos) + (1.0 - _AmbientOcclusionParam.x)); IndirectAO = ssao; DirectAO = lerp(1.0, ssao, _AmbientOcclusionParam.w);#else DirectAO = 1.0; IndirectAO = 1.0;#endifTake a look at the playlist for the whole series:https://www.youtube.com/playlist?list=PL78XDi0TS4lGnGa7L2X4o3UV-XYZEKNwj Here's last week's video on making our custom lighting model modular:https://youtu.be/Ak40WLdV3ic Shader Book Recommendationshttps://www.bencloward.com/resources_books.shtml ------------------------------Theme MusicPeace in the Circuitry - Glitch Hophttp://teknoaxe.com/Link_Code_3.php?q=1526 Background MusicSpeo - The Little Thingshttps://www.youtube.com/watch?v=kvCYuyyLgC0 #UnrealEngine #shadergraph #Unity
0 Σχόλια ·0 Μοιράστηκε ·38 Views