The example code snippet in https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@14.0/manual/use-built-in-shader-methods-shadows.html
only works for a single cascade, but with multiple it procudes artifacts at cascade borders. Is there any place where I can find an example how to get it to work with cascades?
I'm currently studying the Lit shader but it is quite beefy. Maybe there is a more minimalist example somehwer else?
#How to implement multiple shadow cascades in HLSL
1 messages · Page 1 of 1 (latest)
iirc for multiple cascades you just need to calculate the shadowCoord in the fragment function. The lit shader branches around the REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR define to support both options. GetShadowCoord(positions) in vert or TransformWorldToShadowCoord(positionWS) in frag
oh, that was so simple but it would take me so much time to figure out!
One more thing... the shadows in lit shader are soft but mine are very pixelated. Where does the blurring take place? Should I do some kind of gaussian blur or is there already something built-in?
Should be handled by the functions you call already, but there are keywords to enable it
#pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
damn! Thanks a lot!