Class responsible for managing the shadow map. More...
#include <shadow.hpp>
Public Member Functions | |
ShadowMap (int light_type) | |
Constructor for the ShadowMap class. | |
~ShadowMap () | |
Destructor for the ShadowMap class. | |
COPYABLE_AND_MOVABLE (ShadowMap) | |
Macro to make the ShadowMap class movable but not copyable. | |
void | BindFramebuffer () |
Binds the framebuffer for rendering shadows. | |
void | UnbindFramebuffer () |
Unbinds the framebuffer. | |
GLuint | GetDepthMap () const |
Gets the depth map texture. | |
void | SetLightSpaceMatrix (const std::vector< glm::mat4 > &matrix) |
Sets the light space transformation matrices. | |
std::vector< glm::mat4 > | GetLightSpaceMatrix () const |
Gets the light space transformation matrices. | |
Class responsible for managing the shadow map.
The ShadowMap class handles the creation, binding, and management of a shadow map in OpenGL. It supports both point light (using cube maps) and directional light (using 2D textures). The shadow map stores depth information used for simulating shadows in a 3D scene.
Definition at line 38 of file shadow.hpp.
Raftel::ShadowMap::ShadowMap | ( | int | light_type | ) |
Constructor for the ShadowMap class.
Initializes the shadow map based on the specified light type.
light_type | The type of light (1 for point light, other for directional light). |
Raftel::ShadowMap::~ShadowMap | ( | ) |
Destructor for the ShadowMap class.
Releases OpenGL resources associated with the shadow map.
void Raftel::ShadowMap::BindFramebuffer | ( | ) |
Binds the framebuffer for rendering shadows.
This function activates the framebuffer, allowing shadows to be rendered into the shadow map texture.
Raftel::ShadowMap::COPYABLE_AND_MOVABLE | ( | ShadowMap | ) |
|
inline |
Gets the depth map texture.
Definition at line 86 of file shadow.hpp.
|
inline |
Gets the light space transformation matrices.
Definition at line 100 of file shadow.hpp.
|
inline |
Sets the light space transformation matrices.
matrix | A vector of light space transformation matrices. |
Definition at line 93 of file shadow.hpp.
void Raftel::ShadowMap::UnbindFramebuffer | ( | ) |
Unbinds the framebuffer.
This function deactivates the framebuffer, restoring the default framebuffer for rendering.