OGRE: Ogre::PlaneOptimalShadowCameraSetup Class Reference - OGRE Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

# Ogre::PlaneOptimalShadowCameraSetup Class Reference

Implements the plane optimal shadow camera algorithm. More...

`#include <OgreShadowCameraSetupPlaneOptimal.h>`

Inheritance diagram for Ogre::PlaneOptimalShadowCameraSetup:

[legend]
List of all members.

## Public Member Functions

| PlaneOptimalShadowCameraSetup (MovablePlane *plane)
| Constructor -- requires a plane of interest.
virtual | ~PlaneOptimalShadowCameraSetup ()
| Destructor.
virtual void | getShadowCamera (const SceneManager *sm, const Camera *cam, const Viewport *vp, const Light *light, Camera *texCam) const
| Returns shadow camera configured to get 1-1 homography between screen and shadow map when restricted to plane.

## Private Member Functions

| PlaneOptimalShadowCameraSetup ()
| Default constructor is private.
Matrix4 | computeConstrainedProjection (const Vector4 &pinhole, const std::vector< Vector4 > &fpoint, const std::vector< Vector2 > &constraint) const
| helper function computing projection matrix given constraints

## Private Attributes

MovablePlane * | m_plane
| pointer to plane of interest

## Detailed Description

Implements the plane optimal shadow camera algorithm.

Remarks:
  Given a plane of interest, it is possible to set up the shadow camera matrix such that the mapping between screen and shadow map is the identity (when restricted to pixels that view the plane of interest). Therefore, if the shadow map resolution matches the screen space resolution (of the seen planar receiver), we can get pixel perfect shadowing on the plane. Off the plane, the shadowing is not guaranteed to be perfect and will likely exhibit the usual sampling artifacts associated with shadow mapping.

Note:
  Important: this routine requires double-precision calculations. When you are running under Direct3D, you must ensure that you set the floating point mode to 'Consistent' rather than 'Fastest' to ensure this precision. This does allegedly come with some performance cost but when measuring it appears to be negligible in modern systems for normal usage.

  Second important note: this projection also only works for lights with a finite position. Therefore you cannot use it for directional lights at this time.

Definition at line 56 of file OgreShadowCameraSetupPlaneOptimal.h.

## Constructor & Destructor Documentation

Ogre::PlaneOptimalShadowCameraSetup::PlaneOptimalShadowCameraSetup | ( |  | ) | `[private]`

| Default constructor is private. Definition at line 61 of file OgreShadowCameraSetupPlaneOptimal.h.

Ogre::PlaneOptimalShadowCameraSetup::PlaneOptimalShadowCameraSetup | ( | MovablePlane * | plane | ) |

| Constructor -- requires a plane of interest.

virtual Ogre::PlaneOptimalShadowCameraSetup::~PlaneOptimalShadowCameraSetup | ( |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

Matrix4 Ogre::PlaneOptimalShadowCameraSetup::computeConstrainedProjection | ( | const Vector4 & | pinhole,
|  | const std::vector< Vector4 > & | fpoint,
|  | const std::vector< Vector2 > & | constraint
| ) | const`[private]`

| helper function computing projection matrix given constraints

virtual void Ogre::PlaneOptimalShadowCameraSetup::getShadowCamera | ( | const SceneManager * | sm,
|  | const Camera * | cam,
|  | const Viewport * | vp,
|  | const Light * | light,
|  | Camera * | texCam
| ) | const`[virtual]`

| Returns shadow camera configured to get 1-1 homography between screen and shadow map when restricted to plane. Implements Ogre::ShadowCameraSetup.

## Member Data Documentation

MovablePlane* Ogre::PlaneOptimalShadowCameraSetup::m_plane`[private]`

| pointer to plane of interest Definition at line 59 of file OgreShadowCameraSetupPlaneOptimal.h.

The documentation for this class was generated from the following file:

- OgreShadowCameraSetupPlaneOptimal.h

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Thu Mar 6 09:48:50 2008