Performs computations for shadow mapping.
A full computation cycle is made of these steps:
Configure the following values according to the current scene settings:
This object collects the terrain mesh sectors that will act as shadow receivers. Collecting too many mesh sectors will waste CPU cycles, but collecting too few mesh sectors will reduce shadow frustum fitting, which reduces shadow quality and performance, since more geometry will need to be rendered into the shadowmap.
This object will compute the set of mesh sectors that act as shadow casters and thus need to be rendered into the shadowmap. Tweaking can reduce the number of collected mesh sectors, while keeping the triangle count reasonably low, since mesh sectors usually have less triangles when farther away from the view point.
Call Compute, optionally specifying a collector delegate for additional shadow receivers.
Creates a new instance of ShadowMapping.
Returns the Z-range in view-space of the given shadow cascade, to be used for culling shadow casters.
Performs shadow mapping computations (see class remarks).
- See also
Applies the cull flags in FilterIn to the shadow casters.
The camera frustum to use for clipping the bounding boxes of the shadow receivers (see ShadowCascade.Receivers).
The relative overlap of the shadow cascades, along the view direction.
The cascade overlap is applied by shifting the far splitting plane away from the view point, by the amount
S = Zfar * O
Zfar is the view-space Z-coordinate of the far splitting plane of the cascade (see ShadowCascade.ViewRangeZ) and
O is the configured cascade overlap.
The cascade overlap is not applied to the last cascade.
The default value is
The fixed Z-range (in camera-space) of the whole shadow volume, before being split into cascades.
This range only influences the Z-slices of the shadow cascades. All collected shadow receivers will be covered by the shadow maps.
If the given range is empty (see RangeD.IsEmpty), the Z-range will be determined automatically from the collected shadow receivers.
The default value is RangeD.Pos.
The output mesh filter that will receive marks for each terrain part that acts as a shadow receiver.
Controls the amount of light-bleeding correction.
Light-bleeding may occur in shadowed areas that have multiple occluders. Defaults to
The camera view direction that has been used for shadow computations.
- See also
The camera position that has been used for shadow computations.
- See also