Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

renderer
Class ShadowMap

   in ShadowMap.h
   in ShadowMap.cpp

class ShadowMap

Class ShadowMap: Maintain the shadow map texture and perform necessary OpenGL setup, including matrix calculations. The class will automatically generate a texture the first time the shadow map is rendered into. The texture will not be resized afterwards. Can use a simple luminance map to store shadows (no self-shadowing possible) or depth textures (with self-shadowing). Default is to use a luminance map, use SetUseDepthTexture to override the default.


Field Summary
private ShadowMapInternals* m
          
 
Constructor Summary
ShadowMap()
          
~ShadowMap()
          Force the texture/buffer/etc to be recreated, particularly when the renderer's size has changed
 
Method Summary
 void AddShadowedBound( const CBound& bounds )
          CalcShadowMatrices: calculate required matrices for shadow map generation - the light's projection and transformation matrices
 void BeginRender()
          Finish rendering into shadow map texture
 void EndRender()
          Retrieve the texture handle and texture matrix for shadowing
 int GetDepthTextureBits() const
          GetDepthTextureBits: Return the number of bits to use for depth textures when enabled.
 GLuint GetTexture() const
          GetTexture: Retrieve the OpenGL texture object name that contains the shadow map.
 const CMatrix3D& GetTextureMatrix() const
          Using depth textures vs.
 bool GetUseDepthTexture() const
          GetUseDepthTexture: Return whether rendering uses a depth texture (instead of a luminance texture).
 void RecreateTexture()
          SetupFrame: camera and light direction for this frame
 void RenderDebugDisplay()
          RenderDebugDisplay: Visualize shadow mapping calculations to help in debugging and optimal shadow map usage.
 void SetDepthTextureBits( int bits )
          RenderDebugDisplay: debug visualizations - blue: objects in shadow
 void SetupFrame( const CCamera& camera, const CVector3D& lightdir )
          AddShadowedBound: add a world-space bounding box to the bounds of shadowed objects
 void SetUseDepthTexture( bool depthTexture )
          Depth texture bits
 

Field Detail

m

private ShadowMapInternals* m;


Constructor Detail

ShadowMap

public ShadowMap();

~ShadowMap

public ~ShadowMap();
Force the texture/buffer/etc to be recreated, particularly when the renderer's size has changed


Method Detail

AddShadowedBound

public void AddShadowedBound( const CBound& bounds );
CalcShadowMatrices: calculate required matrices for shadow map generation - the light's projection and transformation matrices

BeginRender

public void BeginRender();
Finish rendering into shadow map texture

EndRender

public void EndRender();
Retrieve the texture handle and texture matrix for shadowing

GetDepthTextureBits

public int GetDepthTextureBits() const;
GetDepthTextureBits: Return the number of bits to use for depth textures when enabled.
Returns:
depth texture bit depth

GetTexture

public GLuint GetTexture() const;
GetTexture: Retrieve the OpenGL texture object name that contains the shadow map.
Returns:
the texture name of the shadow map texture

GetTextureMatrix

public const CMatrix3D& GetTextureMatrix() const;
Using depth textures vs. a simple luminance map

GetUseDepthTexture

public bool GetUseDepthTexture() const;
GetUseDepthTexture: Return whether rendering uses a depth texture (instead of a luminance texture). Note that this value may be changed automatically based on OpenGL capabilities. It is guarantueed that it stays constant after SetupFrame until the end of the frame or the next call to SetUseDepthTexture.
Returns:
whether shadow rendering uses depth textures

RecreateTexture

public void RecreateTexture();
SetupFrame: camera and light direction for this frame

RenderDebugDisplay

public void RenderDebugDisplay();
RenderDebugDisplay: Visualize shadow mapping calculations to help in debugging and optimal shadow map usage.

SetDepthTextureBits

public void SetDepthTextureBits( int bits );
RenderDebugDisplay: debug visualizations - blue: objects in shadow

SetupFrame

public void SetupFrame( const CCamera& camera, const CVector3D& lightdir );
AddShadowedBound: add a world-space bounding box to the bounds of shadowed objects

SetUseDepthTexture

public void SetUseDepthTexture( bool depthTexture );
Depth texture bits

 Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
Generated on September 04, 2007 at 18:14
CppDoc v2.4.0
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD