Depth offset that keeps a surface from shadowing itself, or undefined for 0.001
It is a fraction of the shadow map's depth range. Raise it if lit surfaces show stripes of shadow (shadow acne); too much makes shadows start away from their casters.
World-space box a directional light's shadow covers, or undefined to fit the box to the
scene's shadow casters
The fitted box follows the scene, so castShadow: true alone gives a well-sized shadow; past
256 shadow casters, see Light.fitShadowBounds. A box you set is read each time the
shadow redraws, so moving it, say to follow the player, costs nothing extra. Only surfaces
inside the box are sure to get shadows from this light. Ignored when LightShadow.cascades is set.
How many slices the camera's view is cut into, each with its own shadow map, from 1 to 4;
undefined for a fixed box
Directional lights only. More cascades keep distant shadows sharper, at the cost of drawing
the shadow casters once per cascade. 1 follows the camera with one map.
How the distance is shared out between cascades, from 0 to 1
0 gives every cascade an equal slice. 1 gives the nearest cascades the thinnest slices,
so the shadows closest to the camera get the most detail. Cascades only.
How far from the camera the cascades reach, in world units, or undefined for 50
Cascades only. They never reach past the camera's far plane, so the far value caps this. A shorter reach gives sharper shadows.
Offset along the surface normal that keeps a surface from shadowing itself, in world units,
or undefined for the default
A surface the light only grazes moves this far along its normal before its shadow is looked up, and a surface facing the light barely moves. The default is three shadow-map texels for a directional light, so it follows the shadow's resolution, and 0.15 for a spot light. Raise it if shadowed surfaces show striping; lower it if shadows pull away from their casters.
How often the shadow redraws
1 redraws every frame and N every Nth frame. 'manual', or 0, draws once, then again
each time Light.refreshShadows asks. With cascades, an array gives each cascade its own
rate, and a cascade the array leaves out redraws every frame. Slower rates suit a scene that
doesn't move.
A light's shadow settings, as Light.shadow holds them
The same fields as LightShadowOptions, with the defaults filled in. Setting both
boundsandcascadeshere isn't a type error; cascades win and a warning says so.Example