48 ShadowMap(
unsigned int width = 2048,
unsigned int height = 2048);
93 inline unsigned int get_width()
const {
return m_width; }
110 void resize(
unsigned int width,
unsigned int height);
114 unsigned int m_fbo = 0;
117 unsigned int m_depth_map = 0;
120 unsigned int m_width;
123 unsigned int m_height;
160 void bind(
unsigned int face);
199 inline unsigned int get_fbo()
const {
return m_fbo; }
203 unsigned int m_fbo = 0;
206 unsigned int m_depth_cubemap = 0;
209 unsigned int m_resolution;
244 std::shared_ptr<ShadowMap> shadow_map);
257 std::shared_ptr<CubemapShadowMap> shadow_map);
276 std::shared_ptr<Shader> m_depth_shader;
279 std::shared_ptr<Shader> m_depth_cubemap_shader;
290 void render_scene_depth(std::shared_ptr<scene::Scene>
scene,
const glm::mat4 &light_space_matrix);
void unbind()
Unbinds the framebuffer object, returning to the default framebuffer.
Definition shadow_map.cpp:98
void bind(unsigned int face)
Binds the framebuffer object for rendering to a specific face of the cubemap shadow map.
Definition shadow_map.cpp:91
unsigned int get_resolution() const
Returns the resolution of each face of the cubemap shadow map.
Definition shadow_map.hpp:192
unsigned int get_fbo() const
Returns the OpenGL framebuffer object ID.
Definition shadow_map.hpp:199
~CubemapShadowMap()
Destructor for CubemapShadowMap.
Definition shadow_map.cpp:84
CubemapShadowMap(unsigned int resolution=1024)
Constructs a CubemapShadowMap with the specified resolution.
Definition shadow_map.cpp:61
unsigned int get_texture_id() const
Returns the OpenGL texture ID of the cubemap depth texture.
Definition shadow_map.hpp:185
void bind_texture(unsigned int slot=0) const
Binds the cubemap depth texture to the specified texture slot for use in shaders.
Definition shadow_map.cpp:100
ShadowMap(unsigned int width=2048, unsigned int height=2048)
Constructs a ShadowMap with the specified width and height.
Definition shadow_map.cpp:13
unsigned int get_texture_id() const
Returns the OpenGL texture ID of the depth texture.
Definition shadow_map.hpp:86
unsigned int get_width() const
Returns the width of the shadow map texture.
Definition shadow_map.hpp:93
void resize(unsigned int width, unsigned int height)
Resizes the shadow map texture to the specified width and height.
Definition shadow_map.cpp:54
void bind_texture(unsigned int slot=0) const
Binds the depth texture to the specified texture slot for use in shaders.
Definition shadow_map.cpp:49
void bind()
Binds the framebuffer object for rendering to the shadow map.
Definition shadow_map.cpp:41
unsigned int get_height() const
Returns the height of the shadow map texture.
Definition shadow_map.hpp:100
void unbind()
Unbinds the framebuffer object, returning to the default framebuffer.
Definition shadow_map.cpp:47
~ShadowMap()
Destructor for ShadowMap.
Definition shadow_map.cpp:34
ShadowRenderer()
Constructs a ShadowRenderer and initializes depth shaders.
Definition shadow_map.cpp:105
void render_directional_shadow(std::shared_ptr< scene::Scene > scene, std::shared_ptr< scene::Light > light, std::shared_ptr< ShadowMap > shadow_map)
Renders the shadow map for a directional light.
Definition shadow_map.cpp:110
void render_point_shadow(std::shared_ptr< scene::Scene > scene, std::shared_ptr< scene::Light > light, std::shared_ptr< CubemapShadowMap > shadow_map)
Renders the shadow map for a point light.
Definition shadow_map.cpp:131
glm::mat4 get_light_space_matrix(std::shared_ptr< scene::Light > light, const glm::vec3 &scene_center, float scene_radius)
Computes the light space matrix for a directional light.
Definition shadow_map.cpp:224
~ShadowRenderer()=default
Destructor for ShadowRenderer.
Definition of the Light class and LightType enumeration.
Namespace for rendering-related classes and functions.
Definition buffer.cpp:9
Namespace for scene-related classes and functions.
Definition camera.cpp:7
Forward declarations for Assimp Material structure.
Definition model_loader.cpp:12
Defines the Scene class for managing a 3D scene graph.
Declaration of the Shader class for managing shader programs in OpenGL.