trying to dig out the rest from a project that used this … unfortunately that project lay dormant for 3 months and not everything was well documented …
As this is the ONLY available explanation to _LightShadowData on the Internet, allow me to follow up on asking:
How is _LightShadowData.z and _LightShadowData.w computed?
It doesn’t appear to be 1.0 / shadow far distance at all. It’s not even 1.0 / min(camera.farClipPlane, shadowDistance).
What I have tested and believed are:
_LightShadowData.x = 1.0 - shadow distance. _LightShadowData.y = max(camera far clip / shadow distance, 1.0) // but not used in current built-in shader codebase _LightShadowData.z = 5.0f * max(camera far clip / shadow distance, 1.0) / min(camera far clip, shadow distance) // not sure about the 5.0f, but it seems like the value _LightShadowData.w = -1.0f * (2.0f + camera field of view / 180.0f * 2.0f) // fov is regarded as 0 when orthographic.
So, can someone from Unity help us to answer this probably now decade old question?