|
| LiSPSMShadowCameraSetup (void) |
| Default constructor. More...
|
|
virtual | ~LiSPSMShadowCameraSetup (void) |
| Default destructor. More...
|
|
virtual Degree | getCameraLightDirectionThreshold () const |
| Sets the threshold between the camera and the light direction below which the LiSPSM projection is 'flattened', since coincident light and camera projections cause problems with the perspective skew. More...
|
|
virtual Real | getOptimalAdjustFactor () const |
| Get the parameter n used to produce optimal shadows. More...
|
|
virtual void | getShadowCamera (const SceneManager *sm, const Camera *cam, const Viewport *vp, const Light *light, Camera *texCam, size_t iteration) const |
| Returns a LiSPSM shadow camera. More...
|
|
bool | getUseAggressiveFocusRegion () const |
|
virtual bool | getUseSimpleOptimalAdjust () const |
| Gets whether or not to use a slightly simpler version of the camera near point derivation (default is true) More...
|
|
void | operator delete (void *ptr) |
|
void | operator delete (void *ptr, void *) |
|
void | operator delete (void *ptr, const char *, int, const char *) |
|
void | operator delete[] (void *ptr) |
|
void | operator delete[] (void *ptr, const char *, int, const char *) |
|
void * | operator new (size_t sz, const char *file, int line, const char *func) |
| operator new, with debug line info More...
|
|
void * | operator new (size_t sz) |
|
void * | operator new (size_t sz, void *ptr) |
| placement operator new More...
|
|
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
| array operator new, with debug line info More...
|
|
void * | operator new[] (size_t sz) |
|
virtual void | setCameraLightDirectionThreshold (Degree angle) |
| Sets the threshold between the camera and the light direction below which the LiSPSM projection is 'flattened', since coincident light and camera projections cause problems with the perspective skew. More...
|
|
virtual void | setOptimalAdjustFactor (Real n) |
| Adjusts the parameter n to produce optimal shadows. More...
|
|
void | setUseAggressiveFocusRegion (bool aggressive) |
| Sets whether or not to use the more aggressive approach to deciding on the focus region or not. More...
|
|
virtual void | setUseSimpleOptimalAdjust (bool s) |
| Sets whether or not to use a slightly simpler version of the camera near point derivation (default is true) More...
|
|
|
Matrix4 | buildFrustumProjection (Real left, Real right, Real bottom, Real top, Real near, Real far) const |
| Builds a frustum matrix. More...
|
|
Matrix4 | buildViewMatrix (const Vector3 &pos, const Vector3 &dir, const Vector3 &up) const |
| Builds a view matrix. More...
|
|
void | calculateB (const SceneManager &sm, const Camera &cam, const Light &light, const AxisAlignedBox &sceneBB, const AxisAlignedBox &receiverBB, PointListBody *out_bodyB) const |
| Calculates the intersection bodyB. More...
|
|
Matrix4 | calculateLiSPSM (const Matrix4 &lightSpace, const PointListBody &bodyB, const PointListBody &bodyLVS, const SceneManager &sm, const Camera &cam, const Light &light) const |
| Calculates the LiSPSM projection matrix P. More...
|
|
void | calculateLVS (const SceneManager &sm, const Camera &cam, const Light &light, const AxisAlignedBox &sceneBB, PointListBody *out_LVS) const |
| Calculates the bodyLVS. More...
|
|
Real | calculateNOpt (const Matrix4 &lightSpace, const AxisAlignedBox &bodyBABB_ls, const PointListBody &bodyLVS, const Camera &cam) const |
| Calculates the distance between camera position and near clipping plane. More...
|
|
Real | calculateNOptSimple (const PointListBody &bodyLVS, const Camera &cam) const |
| Calculates a simpler version than the one above. More...
|
|
void | calculateShadowMappingMatrix (const SceneManager &sm, const Camera &cam, const Light &light, Matrix4 *out_view, Matrix4 *out_proj, Camera *out_cam) const |
| Calculates the standard shadow mapping matrix. More...
|
|
Vector3 | calculateZ0_ls (const Matrix4 &lightSpace, const Vector3 &e, Real bodyB_zMax_ls, const Camera &cam) const |
| Calculates the visible point on the near plane for the n_opt calculation. More...
|
|
Vector3 | getLSProjViewDir (const Matrix4 &lightSpace, const Camera &cam, const PointListBody &bodyLVS) const |
| Returns the projection view direction. More...
|
|
Vector3 | getNearCameraPoint_ws (const Matrix4 &viewMatrix, const PointListBody &bodyLVS) const |
| Returns a valid near-point seen by the camera. More...
|
|
Matrix4 | transformToUnitCube (const Matrix4 &m, const PointListBody &body) const |
| Transforms a given body to the unit cube (-1,-1,-1) / (+1,+1,+1) with a specific shadow matrix enabled. More...
|
|
Implements the Light Space Perspective Shadow Mapping Algorithm.
- Note
- Shadow mapping was introduced by Williams in 1978. First a depth image is rendered from the light's view and compared in a second pass with depth values of the normal camera view. In case the depth camera's depth value is greater than the depth seen by the light the fragment lies in the shadow. The concept has a major draw back named perspective aliasing. The shadow map distri- butes the samples uniformly meaning the position of the viewer is ignored. For the viewer however the perspective projection affects near objects to be displayed bigger than further away objects. The same thing happens with the shadow map texels: Near shadows appear very coarse and far away shadows are perfectly sampled. In 2002 Stamminger et al. presented an algorithm called Perspective Shadow Maps (PSM). PSM battles the perspective aliasing by distributing 50% of the shadow map texels for objects in the range of <near clipping="" plane>=""> to <near clipping plane * 2> which inverts the problem: The shadows near the viewer are perfectly sampled, however far away shadow may contain aliasing artefacts. A near clipping plane may be a problem. But this is not the only one. In the post-perspective space the light sources are non-intuitively mapped: Directional lights may become point light and point lights may become directional lights. Also light sinks (opposite of a light source) may appear. Another problem are shadow casters located behind the viewer. In post-projective space objects behind the viewer are mapped in front of him with a flipped up-vector. LiSPSM battles the light source problem of the post-projective space by rearranging the light space before transformation in such a way that no special cases appear. This is done by converting point/spot lights into directional lights. The light space is arranged in such a way that the light direction equals the inverse UNIT_Y. In this combination the directional light will neither change its type nor its direction. Furthermore all visible objects and shadow casters affecting the user's visible area lie in front of the shadow camera: After building the intersection body that contains all these objects (body intersection building was introduced with PSM; have a look at the description for the method "calculateB" for further info) a frustum around the body's light space bounding box is created. A parameter (called 'n') automatically adjusts the shadow map sample distribution by specifying the frustum's view point - near plane which affects the perspective warp. In case the distance is small the perspecive warp will be strong. As a consequence near objects will gain quality. However there are still problems. PSM as well as LiSPSM only devote to minimize perspective aliasing. Projection aliasing is still a problem, also 'swimming artefacts' still occur. The LiSPSM quality distribution is very good but not the best available: Some sources say logarithmic shadow mapping is the non plus ultra, however others reject this thought. There is a research project on logarithmic shadow maps. The web page url is http://gamma.cs.unc.edu/logsm/. However there is no techical report available yet (Oct 23rd, 2006).
-
More information can be found on the webpage of the TU Wien: http://www.cg.tuwien.ac.at/research/vr/lispsm/
-
Original implementation by Matthias Fink matth.nosp@m.ias..nosp@m.fink@.nosp@m.web..nosp@m.de, 2006.
Definition at line 98 of file OgreShadowCameraSetupLiSPSM.h.