some functions about shadow map
More...
#include <ShadowMap.h>
|
enum | SHADOW_TECHNIQUE { SHADOWTYPE_PSM =0,
SHADOWTYPE_LSPSM =1,
SHADOWTYPE_TSM =2,
SHADOWTYPE_ORTHO =3
} |
|
some functions about shadow map
§ AddShadowCasterPoint()
void ParaEngine::CShadowMap::AddShadowCasterPoint |
( |
const CShapeAABB & |
aabb | ) |
|
add a shadow caster point.
§ BeginShadowPass()
HRESULT ParaEngine::CShadowMap::BeginShadowPass |
( |
| ) |
|
The function is responsible for building the perspective shadow map projection matrix and set the render and effect states for rendering the actual shadow map.
- Returns
- : return S_OK if succeeded.
§ GetShadowMapTexelSize()
int ParaEngine::CShadowMap::GetShadowMapTexelSize |
( |
| ) |
|
get the size of the shadow map.
assuming width == height.
§ GetShadowTechnique()
SHADOW_TECHNIQUE ParaEngine::CShadowMap::GetShadowTechnique |
( |
| ) |
|
|
inline |
I will support two shadow mapping method.
LiPSM and Orthogonal SM, basically:
- Use LiPSM (with multiple bounding boxes for the terrain receiver): I think it is the best One pass general Shadow Mapping technique.
- Use Orthogonal SM (with only one bounding box for the terrain receiver): It is fast and looks almost the same as TSM. But only a small region of the terrain(shadow receiver) can has shadow.
- TODO: Cascaded Shadow Maps with Orthogonal SM is the final solution for more general cases, which I have not implemented yet.
- Returns
§ PrepareAllSurfaces()
bool ParaEngine::CShadowMap::PrepareAllSurfaces |
( |
| ) |
|
prepare all device objects.
§ SetDefaultShadowMapTexelSizeLevel()
static void ParaEngine::CShadowMap::SetDefaultShadowMapTexelSizeLevel |
( |
int |
nLevel | ) |
|
|
inlinestatic |
set the size level of the shadow map when it is created.
This function is usually called before a shadow map is constructed.
- Parameters
-
nLevel | 0 means 1024 texels; 1 means 1536 texels. default is level 0. |
§ SetShadowMapTexelSize()
void ParaEngine::CShadowMap::SetShadowMapTexelSize |
( |
int |
nWidth, |
|
|
int |
nHeight |
|
) |
| |
Set the size of the shadow map.
§ SetShadowMapTexelSizeLevel()
void ParaEngine::CShadowMap::SetShadowMapTexelSizeLevel |
( |
int |
nLevel | ) |
|
change the size level of the shadow map.
- Parameters
-
nLevel | 0 means 1024 texels; 1 means 1536 texels. default is level 0. |
§ SetShadowTechnique()
void ParaEngine::CShadowMap::SetShadowTechnique |
( |
SHADOW_TECHNIQUE |
technique | ) |
|
|
inline |
I will support two shadow mapping method.
LiPSM and Orthogonal SM, basically:
- Use LiPSM (with multiple bounding boxes for the terrain receiver): I think it is the best One pass general Shadow Mapping technique.
- Use Orthogonal SM (with only one bounding box for the terrain receiver): It is fast and looks almost the same as TSM. But only a small region of the terrain(shadow receiver) can has shadow.
- TODO: Cascaded Shadow Maps with Orthogonal SM is the final solution for more general cases, which I have not implemented yet.
- Parameters
-
technique | enum SHADOW_TECHNIQUE { SHADOWTYPE_PSM=0, SHADOWTYPE_LSPSM=1, SHADOWTYPE_TSM=2, SHADOWTYPE_ORTHO=3, }; |
§ SetShadowTexture()
HRESULT ParaEngine::CShadowMap::SetShadowTexture |
( |
CEffectFile & |
pEffect, |
|
|
int |
nTextureIndex, |
|
|
int |
nUseBlur = 0 |
|
) |
| |
apply the current shadow map to the selected effect file at the specified texture index
- Parameters
-
pEffect | |
nTextureIndex | |
nUseBlur | if 0, the depth shadow map is set, if 1, the blurred image texture is set. blurred image is used for terrain ground or other larger shadow receivers. |
- Returns
§ SupportsHWShadowMaps()
bool ParaEngine::CShadowMap::SupportsHWShadowMaps |
( |
| ) |
|
|
inline |
return true if device support hardware shadow map.
§ UsingBlurredShadowMap()
bool ParaEngine::CShadowMap::UsingBlurredShadowMap |
( |
| ) |
|
|
inline |
whether to use blurred shadow map for the global terrain.
The documentation for this class was generated from the following file: