SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
ShadowMatrices Class Reference

Public Member Functions

void computeMatrixesAndCameras (scene::ICameraSceneNode *const camnode, unsigned int width, unsigned int height)
 Generate View, Projection, Inverse View, Inverse Projection, ViewProjection and InverseProjection matrixes and matrixes and cameras for the four shadow cascade and RSM.
 
void addLight (const core::vector3df &pos)
 
void updateSunOrthoMatrices ()
 
void renderShadowsDebug (const FrameBuffer *shadow_framebuffer, const PostProcessing *post_processing)
 
void resetShadowCamNodes ()
 
scene::ICameraSceneNode ** getShadowCamNodes ()
 
scene::ICameraSceneNode * getSunCam ()
 
std::vector< core::matrix4 > & getSunOrthoMatrices ()
 
const std::pair< float, float > * getShadowScales () const
 
const float * getMatricesData () const
 

Static Public Attributes

static float m_shadow_split [5] = { 1., 5., 20., 50., 150 }
 

Private Member Functions

core::matrix4 getTighestFitOrthoProj (const core::matrix4 &transform, const std::vector< core::vector3df > &pointsInside, std::pair< float, float > &size)
 Given a matrix transform and a set of points returns an orthogonal projection matrix that maps coordinates of transformed points between -1 and 1.
 
void renderWireFrameFrustrum (float *tmp, unsigned i)
 

Private Attributes

std::vector< core::matrix4 > m_sun_ortho_matrices
 
scene::ICameraSceneNode * m_sun_cam
 
scene::ICameraSceneNode * m_shadow_cam_nodes [4]
 
std::pair< float, float > m_shadow_scales [4]
 
core::matrix4 m_rsm_matrix
 
bool m_rsm_matrix_initialized
 
float m_shadows_cam [4][24]
 
bool m_rsm_map_available
 
float m_mat_ubo [16 *9+2]
 

Member Function Documentation

◆ computeMatrixesAndCameras()

void ShadowMatrices::computeMatrixesAndCameras ( scene::ICameraSceneNode *const  camnode,
unsigned int  width,
unsigned int  height 
)

Generate View, Projection, Inverse View, Inverse Projection, ViewProjection and InverseProjection matrixes and matrixes and cameras for the four shadow cascade and RSM.

Parameters
camnodepoint of view used
widthof the rendering viewport
heightof the rendering viewport

◆ getTighestFitOrthoProj()

core::matrix4 ShadowMatrices::getTighestFitOrthoProj ( const core::matrix4 &  transform,
const std::vector< core::vector3df > &  pointsInside,
std::pair< float, float > &  size 
)
private

Given a matrix transform and a set of points returns an orthogonal projection matrix that maps coordinates of transformed points between -1 and 1.

Parameters
transforma transform matrix.
pointsInsidea vector of point in 3d space.
sizereturns the size (width, height) of shadowmap coverage

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