class
SpotShadowAtlasResource which stores the shadow map atlas for spot lights, a large texture that holds the shadow maps for each shadow caster in a quadtree structure, reducing texture switching.
Public functions
- auto getSize() const -> glm::uvec2
- Gets the size of the shadow atlas texture.
-
void resize(cubos::
core:: gl:: RenderDevice& rd) - Recreates the shadow atlas texture.
Public variables
- glm::uvec2 configSize
- Configured size of the shadow atlas texture, in pixels. Use this to change the resolution of the atlas. Note that the texture isn't immediately resized; use getSize() to get the actual texture size.
- bool cleared
- Whether the shadow atlas texture has already been cleared this frame.
-
core::
gl:: Texture2D atlas - Stores shadow maps for each spot shadow caster component.
-
std::vector<std::shared_ptr<cubos::
engine:: ShadowMapSlot>> slots - Stores the sizes, offsets, and caster ids of the shadow maps in the atlas.
-
std::map<int, std::shared_ptr<cubos::
engine:: ShadowMapSlot>> slotsMap - Maps shadow caster ids to their corresponding slots.
Function documentation
glm::uvec2 cubos:: engine:: SpotShadowAtlas:: getSize() const
Gets the size of the shadow atlas texture.
Returns | Size of the shadow atlas texture, in pixels. |
---|
void cubos:: engine:: SpotShadowAtlas:: resize(cubos:: core:: gl:: RenderDevice& rd)
Recreates the shadow atlas texture.
Parameters | |
---|---|
rd | Render device used to create the texture. |