Would love help understanding directional lights and scene shadows in Scene Kit.
The class reference on SCNLight says zFar
represents the maximum distance between the light and a visible surface for casting shadows.
It further suggests this value only applies to spot lights.
However, in the Xcode Scene Editor, under the Attributes Inspector, there is a field for Far Clipping
. Changing this value affects shadows projected by a directional light as illustrated by the screenshots below.
The scenes below were produced by dragging a directional light into the scene and changing the X Euler Angle
value to -60 and ticking the "Casts Shadows" box. The floor texture is taken from the WWDC Fox demo,
Is Far Clipping the same as zFar? If not, what's the difference?
Since directional lights ignore the position property, why does changing the Far Clipping value affect the shadows produced by a directional light?
The goal is to light the whole scene, and project shadows on nodes, as if the sun was at 3 PM in the afternoon on a cloudless day. Is it possible to use a directional light to achieve this? So far, using directional lights can achieve the look where the whole scene is lit, but cannot control shadows as well as a spotlight.
Screenshot #1: Far Clipping value is 10.
Screenshot #2: Far Clipping value is 30.