XLE
v0.02.0
|
Represents a set of shared projections More...
#include <LightDesc.h>
Classes | |
class | FullSubProjection |
struct | Mode |
class | OrthoSubProjection |
Public Member Functions | |
unsigned | Count () const |
Public Attributes | |
Mode::Enum | _mode |
unsigned | _normalProjCount |
bool | _useNearProj |
Float4x4 | _specialNearProjection |
Float4 | _specialNearMinimalProjection |
FullSubProjection | _fullProj [MaxProjections] |
OrthoSubProjection | _orthoSub [MaxProjections] |
Float4x4 | _definitionViewMatrix |
Float4 | _minimalProjection [MaxProjections] |
Represents a set of shared projections
This class is intended to be used with cascaded shadows (and similiar cascaded effects). Multiple cascades require multiple projections, and this class represents a small bundle of cascades.
Sometimes we want to put restrictions on the cascades in order to reduce shader calculations. For example, a collection of orthogonal cascades can be defined by a set of axially aligned volumes in a shared orthogonal projection space.
Float4x4 SceneEngine::MultiProjection< MaxProjections >::_definitionViewMatrix |
When a "OrthoSub" mode, the sub projections have some restrictions There is a single "definition transform" that defines a basic projection that all sub projects inherit. The sub projects then define and axially aligned area of XYZ space inside of the definition transform. When used with an orthogonal transform, this allows each sub projection to wrap a volume of space. But all sub projections must match the rotation and skew of other projections.
FullSubProjection SceneEngine::MultiProjection< MaxProjections >::_fullProj[MaxProjections] |
When in "Full" mode, each sub projection gets a full view and projection matrix. This means that every sub projection can have a completely independently defined projection.
Float4 SceneEngine::MultiProjection< MaxProjections >::_minimalProjection[MaxProjections] |
In both modes, we often need to store the "minimal projection" This is the 4 most important elements of the projection matrix. In typical projection matrices, the remaining parts can be implied which means that these 4 elements is enough to do reverse projection work in the shader. In the case of shadows, mostly we need to convert depth values from projection space into view space (and since view space typically has the same scale as world space, we can assume that view space depth values are in natural world space units).
OrthoSubProjection SceneEngine::MultiProjection< MaxProjections >::_orthoSub[MaxProjections] |
When a "OrthoSub" mode, the sub projections have some restrictions There is a single "definition transform" that defines a basic projection that all sub projects inherit. The sub projects then define and axially aligned area of XYZ space inside of the definition transform. When used with an orthogonal transform, this allows each sub projection to wrap a volume of space. But all sub projections must match the rotation and skew of other projections.