This class implements a shadow map for spot lights (cSpotLight). More...
#include <CShadowMap.h>
Public Member Functions | |
cShadowMap () | |
Constructor of cShadowMap. More... | |
virtual | ~cShadowMap () |
Destructor of cShadowMap. More... | |
void | setEnabled (bool a_enabled) |
This method enables or disables this shadow map. More... | |
bool | getEnabled () const |
This method returns true if the this shadow map is enabled, false otherwise. More... | |
void | setQualityVeryLow () |
This method sets the quality resolution of the shadow map to 256 x 256 pixels. More... | |
void | setQualityLow () |
This method sets the quality resolution of the shadow map to 512 x 512 pixels. More... | |
void | setQualityMedium () |
This method sets the quality resolution of the shadow map to 1024 x 1024 pixels. More... | |
void | setQualityHigh () |
This method sets the quality resolution of the shadow map to 2048 x 2048 pixels. More... | |
void | setQualityVeryHigh () |
This method sets the quality resolution of the shadow map to 4096 x 4096 pixels. More... | |
virtual void | render (cRenderOptions &a_options) |
This method contains the OpenGL rendering code for shadow maps. (Do not call this code directly.) More... | |
bool | updateMap (cWorld *a_world, const cVector3d &a_lightPos, const cVector3d &a_lightLookat, const cVector3d &a_lightUp, const double a_lightFieldViewAngle, const double a_distanceNear, const double a_distanceFar, const double a_mirrorH, const double a_mirrorV) |
This method updates the shadow map. (Do not call this code directly.) More... | |
Public Member Functions inherited from chai3d::cFrameBuffer | |
cFrameBuffer () | |
Constructor of cFrameBuffer. More... | |
virtual | ~cFrameBuffer () |
Destructor of cFrameBuffer. More... | |
void | setup (cCamera *a_camera=NULL, const unsigned int a_width=0, const unsigned int a_height=0, const bool a_enableImageBuffer=true, const bool a_enableDepthBuffer=true) |
This method initializes the framebuffer. More... | |
void | renderView (const cEyeMode a_eyeMode=C_STEREO_LEFT_EYE) |
This method renders the framebuffer view. More... | |
void | copyImageBuffer (cImagePtr a_image) |
This method copies the framebuffer content to an image. More... | |
void | copyDepthBuffer (cImagePtr a_image) |
This method copies the depth buffer content to an image. More... | |
void | setCamera (cCamera *a_camera) |
This method attaches a camera to the framebuffer. More... | |
cCamera * | getCamera () |
This method returns a pointer to the camera attached to the framebuffer. More... | |
unsigned int | getWidth () const |
This method returns the width in pixels of the framebuffer. More... | |
unsigned int | getHeight () const |
This method returns the height in pixels of the framebuffer. More... | |
void | setSize (const unsigned int a_width, const unsigned int a_height) |
This method sets the resolution of the framebuffer by defining its width and height in pixels. More... | |
bool | renderInitialize () |
This method initializes rendering to the framebuffer. More... | |
bool | renderFinalize () |
This method finalizes the rendering to the framebuffer. More... | |
Public Attributes | |
cTransform | m_lightProjectionMatrix |
Projection matrix of the light source creating this shadow. More... | |
cTransform | m_lightViewMatrix |
View matrix of the light source creating this shadow. More... | |
Public Attributes inherited from chai3d::cFrameBuffer | |
cTexture2dPtr | m_imageBuffer |
Image buffer. More... | |
cTexture2dPtr | m_depthBuffer |
Depth buffer. More... | |
Protected Attributes | |
bool | m_enabled |
If true, then shadow map is enabled, false otherwise. More... | |
Protected Attributes inherited from chai3d::cFrameBuffer | |
bool | m_useImageBuffer |
If true then image buffer is enabled, false otherwise. More... | |
bool | m_useDepthBuffer |
If true then image buffer is enabled, false otherwise. More... | |
unsigned int | m_width |
Width in pixels of the frame buffer. More... | |
unsigned int | m_height |
Height in pixels of the frame buffer. More... | |
unsigned int | m_prevWidth |
Last width value that was used when allocating texture size. More... | |
unsigned int | m_prevHeight |
Last height value that was used when allocating texture size. More... | |
cCamera * | m_camera |
Camera associated with this framebuffer. More... | |
GLuint | m_fbo |
OpenGL frame buffer object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from chai3d::cFrameBuffer | |
static cFrameBufferPtr | create () |
Shared cFrameBuffer allocator. More... | |
This class implements a shadow map texture for spot lights (cSpotLight).
chai3d::cShadowMap::cShadowMap | ( | ) |
Constructor of cShadowMap.
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
This method contains the OpenGL rendering code for the shadowmap. This code is called internally by CHAI3D. Do not call this method directly.
a_options | Rendering options. |
bool chai3d::cShadowMap::updateMap | ( | cWorld * | a_world, |
const cVector3d & | a_lightPos, | ||
const cVector3d & | a_lightLookat, | ||
const cVector3d & | a_lightUp, | ||
const double | a_lightFieldViewAngle, | ||
const double | a_distanceNear, | ||
const double | a_distanceFar, | ||
const double | a_mirrorH, | ||
const double | a_mirrorV | ||
) |
This method creates a shadow map by providing a world and view point information.
a_world | World in which to create shadow |
a_lightPos | Position of eye. |
a_lightLookat | Eye lookat position |
a_lightUp | Eye orientation (up vector). |
a_lightFieldViewAngle | Field of view of light source |
a_distanceNear | Distance to near clipping plane. |
a_distanceFar | Distance to far clipping plane. |
a_mirrorH | Scale factor for horizontal mirroring (-1.0 or 1.0) |
a_mirrorV | Scale factor for vertical mirroring (-1.0 or 1.0) |
cTransform chai3d::cShadowMap::m_lightProjectionMatrix |
cTransform chai3d::cShadowMap::m_lightViewMatrix |
|
protected |