Directional Shadows
After spotlight shadows, we add support for directional shadows. Mixing directional and spotlight shadows requires a little work. Once that's finished, we move on to cascaded shadow maps. We'll define a main light that uses a separate cascaded shadow map to better use our shadow texels.
Comments (4)
https://docs.unity3d.com/2019.1/Documentation/ScriptReference/Rendering.CullingResults.ComputeDirectionalShadowMatricesAndCullingPrimitives.html shadowNearPlaneOffset I found that shadowNearPlaneOffset should not be shadow near plane. Even LWRP did wrong in this part. The offset will push the near plane farther from the far plane so that shadow will still be rendered when camera get too close to a plane which should recieve shadow from a very far object. But I don't know what should be a suitable value for this offset. For now I'm using shadow distance for it.
It should be the Near Plane value of the spotlight. You can change its value and observe the shadows very close the light get cut off as it increases.
Hello,thank you for your amazing tutorials! There are some questions I dont understand: Why dont you send the shadow distance as 'globalShadowData' in Function ‘RenderCascadedShadows’(but do so in Function "RenderShadow")?Say that there is a scene with just one directional mainlight, shaders are not going to receive shadow distance paras beacuse there are no 'RenderShadow' but only ‘RenderCascadedShadows’。
That's an oversight. It's because I only made cascaded shadows honor the shadow distance at the end and forgot to provide the shadow distance for that case. I'll amend that when I publish the next installment. Thanks for pointing it out!
