19#ifndef HEADER_SHADOW_MATRICES_HPP
20#define HEADER_SHADOW_MATRICES_HPP
22#include "graphics/gl_headers.hpp"
31 namespace scene {
class ICameraSceneNode; }
42 static float m_shadow_split[5];
45 std::vector<core::matrix4> m_sun_ortho_matrices;
46 scene::ICameraSceneNode *m_sun_cam;
47 scene::ICameraSceneNode *m_shadow_cam_nodes[4];
48 std::pair<float, float> m_shadow_scales[4];
49 core::matrix4 m_rsm_matrix;
50 bool m_rsm_matrix_initialized;
51 float m_shadows_cam[4][24];
52 bool m_rsm_map_available;
53 float m_mat_ubo[16 * 9 + 2];
56 const std::vector<core::vector3df> &pointsInside,
57 std::pair<float, float> &size);
58 void renderWireFrameFrustrum(
float *tmp,
unsigned i);
65 unsigned int width,
unsigned int height);
66 void addLight(
const core::vector3df &pos);
67 void updateSunOrthoMatrices();
68 void renderShadowsDebug(
const FrameBuffer* shadow_framebuffer,
72 void resetShadowCamNodes();
74 scene::ICameraSceneNode** getShadowCamNodes()
76 return m_shadow_cam_nodes;
79 scene::ICameraSceneNode* getSunCam() {
return m_sun_cam; }
81 std::vector<core::matrix4>& getSunOrthoMatrices()
83 return m_sun_ortho_matrices;
86 const std::pair<float, float>* getShadowScales()
const
88 return m_shadow_scales;
91 const float* getMatricesData()
const {
return m_mat_ubo; }
Definition: frame_buffer.hpp:33
Handles post processing, eg motion blur.
Definition: post_processing.hpp:42
Definition: shadow_matrices.hpp:40
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 coordi...
Definition: shadow_matrices.cpp:147
void computeMatrixesAndCameras(scene::ICameraSceneNode *const camnode, unsigned int width, unsigned int height)
Generate View, Projection, Inverse View, Inverse Projection, ViewProjection and InverseProjection mat...
Definition: shadow_matrices.cpp:196