Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::ShadowMap Class Reference

All the information needed for a single light's shadowmap. More...

#include <ShadowMap.h>

Classes

struct  ShadowLayerData
 

Static Public Member Functions

static void initShadowMaps (GFXDevice &context)
 
static void destroyShadowMaps (GFXDevice &context)
 
static void reset ()
 
static void resetShadowMaps ()
 
static void bindShadowMaps (GFX::CommandBuffer &bufferInOut)
 
static U32 getLightLayerRequirements (const Light &light)
 
static bool freeShadowMapOffset (const Light &light)
 
static bool markShadowMapsUsed (Light &light)
 
static bool generateShadowMaps (const Camera &playerCamera, Light &light, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
 
static ShadowType getShadowTypeForLightType (LightType type) noexcept
 
static LightType getLightTypeForShadowType (ShadowType type) noexcept
 
static const RenderTargetHandlegetShadowMap (LightType type)
 
static const RenderTargetHandlegetShadowMapCache (LightType type)
 
static const RenderTargetHandlegetShadowMap (ShadowType type)
 
static const RenderTargetHandlegetShadowMapCache (ShadowType type)
 
static void setDebugViewLight (GFXDevice &context, Light *light)
 
static void setMSAASampleCount (ShadowType type, U8 sampleCount)
 
static vector< Camera * > & shadowCameras (const ShadowType type) noexcept
 
static void generateWorldAO (const Camera &playerCamera, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
 

Static Public Attributes

static constexpr U8 MAX_SHADOW_FRAME_LIFETIME = 32u
 
static constexpr U8 WORLD_AO_LAYER_INDEX = (Config::Lighting::MAX_SHADOW_CASTING_DIRECTIONAL_LIGHTS * Config::Lighting::MAX_CSM_SPLITS_PER_LIGHT)
 

Protected Types

using LayerLifetimeMask = vector< ShadowLayerData >
 
using ShadowCameraPool = vector< Camera * >
 

Static Protected Member Functions

static bool commitLayerRange (Light &light)
 
static bool freeShadowMapOffsetLocked (const Light &light)
 

Static Protected Attributes

static Mutex s_shadowMapUsageLock
 
static std::array< LayerLifetimeMask, to_base(ShadowType::COUNT)> s_shadowMapLifetime
 
static vector< std::unique_ptr< ShadowMapGenerator > > s_shadowMapGenerators
 
static std::array< RenderTargetHandle, to_base(ShadowType::COUNT)> s_shadowMaps
 
static std::array< RenderTargetHandle, to_base(ShadowType::COUNT)> s_shadowMapCaches
 
static vector< DebugView_ptr > s_debugViews
 
static Lights_shadowPreviewLight = nullptr
 
static std::array< U16, to_base(ShadowType::COUNT)> s_shadowPassIndex
 
static std::array< ShadowCameraPool, to_base(ShadowType::COUNT)> s_shadowCameras
 

Detailed Description

All the information needed for a single light's shadowmap.

Definition at line 88 of file ShadowMap.h.

Member Typedef Documentation

◆ LayerLifetimeMask

Definition at line 135 of file ShadowMap.h.

◆ ShadowCameraPool

Definition at line 145 of file ShadowMap.h.

Member Function Documentation

◆ bindShadowMaps()

void Divide::ShadowMap::bindShadowMaps ( GFX::CommandBuffer bufferInOut)
static

Definition at line 305 of file ShadowMap.cpp.

◆ commitLayerRange()

bool Divide::ShadowMap::commitLayerRange ( Light light)
staticprotected

Definition at line 356 of file ShadowMap.cpp.

◆ destroyShadowMaps()

void Divide::ShadowMap::destroyShadowMaps ( GFXDevice context)
static

Definition at line 239 of file ShadowMap.cpp.

◆ freeShadowMapOffset()

bool Divide::ShadowMap::freeShadowMapOffset ( const Light light)
static

Definition at line 329 of file ShadowMap.cpp.

◆ freeShadowMapOffsetLocked()

bool Divide::ShadowMap::freeShadowMapOffsetLocked ( const Light light)
staticprotected

Definition at line 335 of file ShadowMap.cpp.

◆ generateShadowMaps()

bool Divide::ShadowMap::generateShadowMaps ( const Camera playerCamera,
Light light,
GFX::CommandBuffer bufferInOut,
GFX::MemoryBarrierCommand memCmdInOut 
)
static

Definition at line 468 of file ShadowMap.cpp.

◆ generateWorldAO()

void Divide::ShadowMap::generateWorldAO ( const Camera playerCamera,
GFX::CommandBuffer bufferInOut,
GFX::MemoryBarrierCommand memCmdInOut 
)
static

Definition at line 490 of file ShadowMap.cpp.

◆ getLightLayerRequirements()

U32 Divide::ShadowMap::getLightLayerRequirements ( const Light light)
static

Definition at line 442 of file ShadowMap.cpp.

◆ getLightTypeForShadowType()

LightType Divide::ShadowMap::getLightTypeForShadowType ( ShadowType  type)
staticnoexcept

Definition at line 60 of file ShadowMap.cpp.

◆ getShadowMap() [1/2]

const RenderTargetHandle & Divide::ShadowMap::getShadowMap ( LightType  type)
static

Definition at line 495 of file ShadowMap.cpp.

◆ getShadowMap() [2/2]

const RenderTargetHandle & Divide::ShadowMap::getShadowMap ( ShadowType  type)
static

Definition at line 504 of file ShadowMap.cpp.

◆ getShadowMapCache() [1/2]

const RenderTargetHandle & Divide::ShadowMap::getShadowMapCache ( LightType  type)
static

Definition at line 500 of file ShadowMap.cpp.

◆ getShadowMapCache() [2/2]

const RenderTargetHandle & Divide::ShadowMap::getShadowMapCache ( ShadowType  type)
static

Definition at line 509 of file ShadowMap.cpp.

◆ getShadowTypeForLightType()

ShadowType Divide::ShadowMap::getShadowTypeForLightType ( LightType  type)
staticnoexcept

Definition at line 47 of file ShadowMap.cpp.

◆ initShadowMaps()

void Divide::ShadowMap::initShadowMaps ( GFXDevice context)
static

Definition at line 73 of file ShadowMap.cpp.

◆ markShadowMapsUsed()

bool Divide::ShadowMap::markShadowMapsUsed ( Light light)
static

Definition at line 455 of file ShadowMap.cpp.

◆ reset()

void Divide::ShadowMap::reset ( )
static

Definition at line 273 of file ShadowMap.cpp.

◆ resetShadowMaps()

void Divide::ShadowMap::resetShadowMaps ( )
static

Definition at line 286 of file ShadowMap.cpp.

◆ setDebugViewLight()

void Divide::ShadowMap::setDebugViewLight ( GFXDevice context,
Light light 
)
static

Definition at line 522 of file ShadowMap.cpp.

◆ setMSAASampleCount()

void Divide::ShadowMap::setMSAASampleCount ( ShadowType  type,
U8  sampleCount 
)
static

Definition at line 514 of file ShadowMap.cpp.

◆ shadowCameras()

static vector< Camera * > & Divide::ShadowMap::shadowCameras ( const ShadowType  type)
inlinestaticnoexcept

Definition at line 122 of file ShadowMap.h.

Member Data Documentation

◆ MAX_SHADOW_FRAME_LIFETIME

constexpr U8 Divide::ShadowMap::MAX_SHADOW_FRAME_LIFETIME = 32u
staticconstexpr

Definition at line 90 of file ShadowMap.h.

◆ s_debugViews

vector< DebugView_ptr > Divide::ShadowMap::s_debugViews
staticprotected

Definition at line 142 of file ShadowMap.h.

◆ s_shadowCameras

std::array< ShadowMap::ShadowCameraPool, to_base(ShadowType::COUNT)> Divide::ShadowMap::s_shadowCameras
staticprotected

Definition at line 147 of file ShadowMap.h.

◆ s_shadowMapCaches

std::array< RenderTargetHandle, to_base(ShadowType::COUNT)> Divide::ShadowMap::s_shadowMapCaches
staticprotected

Definition at line 141 of file ShadowMap.h.

◆ s_shadowMapGenerators

vector< std::unique_ptr< ShadowMapGenerator > > Divide::ShadowMap::s_shadowMapGenerators
staticprotected

Definition at line 138 of file ShadowMap.h.

◆ s_shadowMapLifetime

std::array< ShadowMap::LayerLifetimeMask, to_base(ShadowType::COUNT)> Divide::ShadowMap::s_shadowMapLifetime
staticprotected

Definition at line 137 of file ShadowMap.h.

◆ s_shadowMaps

std::array< RenderTargetHandle, to_base(ShadowType::COUNT)> Divide::ShadowMap::s_shadowMaps
staticprotected

Definition at line 140 of file ShadowMap.h.

◆ s_shadowMapUsageLock

Mutex Divide::ShadowMap::s_shadowMapUsageLock
staticprotected

Definition at line 136 of file ShadowMap.h.

◆ s_shadowPassIndex

std::array< U16, to_base(ShadowType::COUNT)> Divide::ShadowMap::s_shadowPassIndex
staticprotected

Definition at line 146 of file ShadowMap.h.

◆ s_shadowPreviewLight

Light * Divide::ShadowMap::s_shadowPreviewLight = nullptr
staticprotected

Definition at line 144 of file ShadowMap.h.

◆ WORLD_AO_LAYER_INDEX

constexpr U8 Divide::ShadowMap::WORLD_AO_LAYER_INDEX = (Config::Lighting::MAX_SHADOW_CASTING_DIRECTIONAL_LIGHTS * Config::Lighting::MAX_CSM_SPLITS_PER_LIGHT)
staticconstexpr

Definition at line 91 of file ShadowMap.h.


The documentation for this class was generated from the following files: