If I take a guess, the shadow map camera is the one from the light’s perspective? So then the far value for that camera determines how far away shadows can appear? If objects are further than that from a light, the shadows don’t appear?
Yes, that is the purpose of far. It says basically how far away the shadow is even relevant plus it’s comparison to other lights (the sun outdoes a simple lamp, so the lamp wont cast any shadow). So it’s not only distance, but almost like power.
Cool, thanks for painting that picture @TheCodeCrafter. Do you mean light.shadow.camera.far is like power? Does the shadow abruptly cut off after that point?
So (I’m guessing) in our scenes we need to take care to make sure the light camera always encompasses the objects that shadow will be rendered on, otherwise the Z clipping of the shadow area could cause irregular shadow shapes on the receiving objects if they are intersecting with the far plane of the light camera.
Interesting. I’m trying to make things easy in my API, so I think what I’ll do is somehow allow the user to specify a light, which objects are receivers of shadows from that light, then my API internally would adjust the light camera dimensions to make sure it automatically encompasses the furthest object. I want the dev experience to be super simple (for HTML devs that may not know much JavaScript let alone how to write an algorithm to dynamically adjust the camera frustum).