18#ifndef INCLUDED_SHADOWMAP
19#define INCLUDED_SHADOWMAP
T bits(T num, size_t lo_idx, size_t hi_idx)
extract the value of bits hi_idx:lo_idx within num
Definition: bits.h:97
Definition: BoundingBoxAligned.h:34
Definition: Vector3D.h:31
Definition: IDeviceCommandContext.h:42
IShaderProgram is a container for multiple shaders of different types.
Definition: IShaderProgram.h:81
Class ShadowMap: Maintain the shadow map texture and perform necessary OpenGL setup,...
Definition: ShadowMap.h:39
void SetDepthTextureBits(int bits)
SetDepthTextureBits: Sets the number of bits to use for depth textures when enabled.
Definition: ShadowMap.cpp:695
void EndRender(Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
Finishes rendering into the shadow map.
Definition: ShadowMap.cpp:635
ShadowMap(Renderer::Backend::IDevice *device)
Definition: ShadowMap.cpp:187
void SetupFrame(const CCamera &camera, const CVector3D &lightdir)
SetupFrame: Configure light space for the given camera and light direction, create the shadow texture...
Definition: ShadowMap.cpp:233
void AddShadowReceiverBound(const CBoundingBoxAligned &bounds)
Add the bounding box of an object that will receive a shadow.
Definition: ShadowMap.cpp:338
void RenderDebugBounds()
Visualize shadow mapping calculations to help in debugging and optimal shadow map usage.
Definition: ShadowMap.cpp:706
void AddShadowCasterBound(const int cascade, const CBoundingBoxAligned &bounds)
Add the bounding box of an object that will cast a shadow.
Definition: ShadowMap.cpp:330
CFrustum GetShadowCasterCullFrustum(const int cascade)
Compute the frustum originating at the light source, that encompasses all the objects passed into Add...
Definition: ShadowMap.cpp:346
~ShadowMap()
Definition: ShadowMap.cpp:210
int GetDepthTextureBits() const
GetDepthTextureBits: Return the number of bits to use for depth textures when enabled.
Definition: ShadowMap.cpp:690
void BeginRender(Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
Sets backend state for rendering into the shadow map texture.
Definition: ShadowMap.cpp:601
void BindTo(Renderer::Backend::IDeviceCommandContext *deviceCommandContext, Renderer::Backend::IShaderProgram *shader) const
Binds all needed resources and uniforms to draw shadows using the shader.
Definition: ShadowMap.cpp:645
ShadowMapInternals * m
Definition: ShadowMap.h:137
void PrepareCamera(Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const int cascade)
Sets the renderer camera for the cascade.
Definition: ShadowMap.cpp:610
int GetCascadeCount() const
Returns the current number of used cascades.
Definition: ShadowMap.cpp:738
void RecreateTexture()
RecreateTexture: Destroy the current shadow texture and force creation of a new one.
Definition: ShadowMap.cpp:221
Struct ShadowMapInternals: Internal data for the ShadowMap implementation.
Definition: ShadowMap.cpp:58