Nebula
Loading...
Searching...
No Matches
Lighting::CSMUtil Class Reference

#include <csmutil.h>

Detailed Description

Helper class for creating and rendering Cascading Shadow Maps.

Classes

struct  CascadeFrustum
 

Public Member Functions

 CSMUtil (const uint numCascades)
 constructor
 
virtual ~CSMUtil ()
 destructor
 
void SetCameraEntity (const Graphics::GraphicsEntityId camera)
 sets the camera entity
 
const Graphics::GraphicsEntityId GetCameraEntity () const
 get the camera entity
 
void SetShadowBox (const Math::bbox &sceneBox)
 sets the scene bounding box
 
void SetGlobalLight (const Graphics::GraphicsEntityId globalLight)
 sets the global light entity
 
const Graphics::GraphicsEntityId GetGlobalLight () const
 gets the global light entity
 
void SetTextureWidth (int width)
 sets the texture width for the CSM texture buffer
 
void SetBlurSize (int size)
 sets the CSM blur size
 
void SetFitTexels (bool state)
 sets whether or not the CSM should clamp the cascades to fit the size of the texels
 
const Math::mat4GetCascadeViewProjection (IndexT cascadeIndex) const
 gets computed view projection transform (valid after Compute)
 
const Math::mat4GetShadowView () const
 gets the shadow view transform (valid after Compute)
 
const Util::FixedArray< Math::mat4 > & GetCascadeProjectionTransforms () const
 returns raw pointer to array of cascade transforms
 
const Util::FixedArray< float > & GetCascadeDistances () const
 returns raw pointer to array of cascade distances
 
const Math::mat4GetCascadeCamera (IndexT index) const
 gets cascade debug camera (only valid after Compute, and if the debug flag is set)
 
void Compute (const Graphics::GraphicsEntityId camera, const Graphics::GraphicsEntityId light)
 computes the splits
 

Private Attributes

Math::bbox shadowBox
 
Math::vec4 frustumCenter
 
Graphics::GraphicsEntityId globalLight
 
Graphics::GraphicsEntityId cameraEntity
 
uint numCascades
 
Util::FixedArray< Math::mat4cascadeProjectionTransform
 
Util::FixedArray< Math::mat4cascadeViewProjectionTransform
 
Util::FixedArray< float > cascadeDistances
 
Util::FixedArray< float > intervalDistances
 
Math::mat4 shadowView
 
float cascadeMaxDistance
 

Constructor & Destructor Documentation

◆ CSMUtil()

Lighting::CSMUtil::CSMUtil ( const uint numCascades)

constructor

◆ ~CSMUtil()

Lighting::CSMUtil::~CSMUtil ( )
virtual

destructor

Member Function Documentation

◆ Compute()

void Lighting::CSMUtil::Compute ( const Graphics::GraphicsEntityId camera,
const Graphics::GraphicsEntityId light )

computes the splits

◆ GetCameraEntity()

const Graphics::GraphicsEntityId Lighting::CSMUtil::GetCameraEntity ( ) const
inline

get the camera entity

◆ GetCascadeCamera()

const Math::mat4 & Lighting::CSMUtil::GetCascadeCamera ( IndexT index) const

gets cascade debug camera (only valid after Compute, and if the debug flag is set)

◆ GetCascadeDistances()

const Util::FixedArray< float > & Lighting::CSMUtil::GetCascadeDistances ( ) const
inline

returns raw pointer to array of cascade distances

◆ GetCascadeProjectionTransforms()

const Util::FixedArray< Math::mat4 > & Lighting::CSMUtil::GetCascadeProjectionTransforms ( ) const
inline

returns raw pointer to array of cascade transforms

◆ GetCascadeViewProjection()

const Math::mat4 & Lighting::CSMUtil::GetCascadeViewProjection ( IndexT cascadeIndex) const
inline

gets computed view projection transform (valid after Compute)

◆ GetGlobalLight()

const Graphics::GraphicsEntityId Lighting::CSMUtil::GetGlobalLight ( ) const
inline

gets the global light entity

◆ GetShadowView()

const Math::mat4 & Lighting::CSMUtil::GetShadowView ( ) const
inline

gets the shadow view transform (valid after Compute)

◆ SetBlurSize()

void Lighting::CSMUtil::SetBlurSize ( int size)

sets the CSM blur size

◆ SetCameraEntity()

void Lighting::CSMUtil::SetCameraEntity ( const Graphics::GraphicsEntityId camera)
inline

sets the camera entity

◆ SetFitTexels()

void Lighting::CSMUtil::SetFitTexels ( bool state)

sets whether or not the CSM should clamp the cascades to fit the size of the texels

◆ SetGlobalLight()

void Lighting::CSMUtil::SetGlobalLight ( const Graphics::GraphicsEntityId globalLight)
inline

sets the global light entity

◆ SetShadowBox()

void Lighting::CSMUtil::SetShadowBox ( const Math::bbox & sceneBox)
inline

sets the scene bounding box

◆ SetTextureWidth()

void Lighting::CSMUtil::SetTextureWidth ( int width)

sets the texture width for the CSM texture buffer

Member Data Documentation

◆ cameraEntity

Graphics::GraphicsEntityId Lighting::CSMUtil::cameraEntity
private

◆ cascadeDistances

Util::FixedArray<float> Lighting::CSMUtil::cascadeDistances
private

◆ cascadeMaxDistance

float Lighting::CSMUtil::cascadeMaxDistance
private

◆ cascadeProjectionTransform

Util::FixedArray<Math::mat4> Lighting::CSMUtil::cascadeProjectionTransform
private

◆ cascadeViewProjectionTransform

Util::FixedArray<Math::mat4> Lighting::CSMUtil::cascadeViewProjectionTransform
private

◆ frustumCenter

Math::vec4 Lighting::CSMUtil::frustumCenter
private

◆ globalLight

Graphics::GraphicsEntityId Lighting::CSMUtil::globalLight
private

◆ intervalDistances

Util::FixedArray<float> Lighting::CSMUtil::intervalDistances
private

◆ numCascades

uint Lighting::CSMUtil::numCascades
private

◆ shadowBox

Math::bbox Lighting::CSMUtil::shadowBox
private

◆ shadowView

Math::mat4 Lighting::CSMUtil::shadowView
private

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