33#ifndef DVD_SHADOW_MAP_H_
34#define DVD_SHADOW_MAP_H_
49 "SINGLE",
"CSM",
"CUBEMAP",
"UNKNOWN"
56class SceneRenderState;
62 struct MemoryBarrierCommand;
90 static constexpr U8 MAX_SHADOW_FRAME_LIFETIME = 32u;
91 static constexpr U8 WORLD_AO_LAYER_INDEX = (Config::Lighting::MAX_SHADOW_CASTING_DIRECTIONAL_LIGHTS * Config::Lighting::MAX_CSM_SPLITS_PER_LIGHT) ;
95 static void initShadowMaps(
GFXDevice& context);
96 static void destroyShadowMaps(
GFXDevice& context);
101 static void resetShadowMaps();
104 static U32 getLightLayerRequirements(
const Light& light);
105 static bool freeShadowMapOffset(
const Light& light);
106 static bool markShadowMapsUsed(
Light& light);
120 static void setMSAASampleCount(
ShadowType type,
U8 sampleCount);
127 static bool commitLayerRange(
Light& light);
128 static bool freeShadowMapOffsetLocked(
const Light& light);
133 U16 _lifetime = MAX_SHADOW_FRAME_LIFETIME;
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
A light object placed in the scene at a certain position.
virtual ~ShadowMapGenerator()=default
virtual void updateMSAASampleCount(const U8 sampleCount)
virtual void render(const Camera &playerCamera, Light &light, U16 lightIndex, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)=0
All the information needed for a single light's shadowmap.
static Light * s_shadowPreviewLight
static std::array< RenderTargetHandle, to_base(ShadowType::COUNT)> s_shadowMapCaches
static vector< DebugView_ptr > s_debugViews
static std::array< RenderTargetHandle, to_base(ShadowType::COUNT)> s_shadowMaps
static std::array< ShadowCameraPool, to_base(ShadowType::COUNT)> s_shadowCameras
static vector< std::unique_ptr< ShadowMapGenerator > > s_shadowMapGenerators
vector< Camera * > ShadowCameraPool
vector< ShadowLayerData > LayerLifetimeMask
static Mutex s_shadowMapUsageLock
static vector< Camera * > & shadowCameras(const ShadowType type) noexcept
static std::array< U16, to_base(ShadowType::COUNT)> s_shadowPassIndex
static std::array< LayerLifetimeMask, to_base(ShadowType::COUNT)> s_shadowMapLifetime
static const char * shadowType[]
Handle console commands that start with a forward slash.
eastl::vector< Type > vector
LightType
The different types of lights supported.
constexpr auto to_base(const Type value) -> Type