MAGE  v0.171.0
Matthias Advanced Game Engine
mage::rendering::ShadowMapBuffer Class Reference

#include <shadow_map_buffer.hpp>

Public Member Functions

 ShadowMapBuffer (ID3D11Device &device, std::size_t nb_shadow_maps, const U32x2 &resolution={ 512u, 512u }, DepthFormat format=DepthFormat::D16)
 
 ShadowMapBuffer (const ShadowMapBuffer &buffer)=delete
 
 ShadowMapBuffer (ShadowMapBuffer &&buffer) noexcept
 
 ~ShadowMapBuffer ()
 
ShadowMapBufferoperator= (const ShadowMapBuffer &buffer)=delete
 
ShadowMapBufferoperator= (ShadowMapBuffer &&buffer) noexcept
 
std::size_t GetNumberOfShadowMaps () const noexcept
 
void Bind (ID3D11DeviceContext &device_context) const noexcept
 
void BindRasterizerState (ID3D11DeviceContext &device_context) const noexcept
 
void ClearDSVs (ID3D11DeviceContext &device_context) const noexcept
 
void BindDSV (ID3D11DeviceContext &device_context, std::size_t dsv_index) const noexcept
 
ID3D11DepthStencilView & GetDSV (std::size_t dsv_index) const noexcept
 
ID3D11ShaderResourceView & GetSRV () const noexcept
 

Private Member Functions

void SetupRasterizerState (ID3D11Device &device)
 
void SetupShadowMapBuffer (ID3D11Device &device, std::size_t nb_shadow_maps)
 
void SetupShadowMapArray (ID3D11Device &device, std::size_t nb_shadow_maps, DXGI_FORMAT texture_format, DXGI_FORMAT dsv_format, DXGI_FORMAT srv_format)
 

Private Attributes

DepthFormat m_format
 
Viewport m_viewport
 
ComPtr< ID3D11RasterizerState > m_rasterizer_state
 
std::vector< ComPtr< ID3D11DepthStencilView > > m_dsvs
 
ComPtr< ID3D11ShaderResourceView > m_srv
 

Constructor & Destructor Documentation

◆ ShadowMapBuffer() [1/3]

mage::rendering::ShadowMapBuffer::ShadowMapBuffer ( ID3D11Device &  device,
std::size_t  nb_shadow_maps,
const U32x2 resolution = { 512u, 512u },
DepthFormat  format = DepthFormat::D16 
)
explicit

◆ ShadowMapBuffer() [2/3]

mage::rendering::ShadowMapBuffer::ShadowMapBuffer ( const ShadowMapBuffer buffer)
delete

◆ ShadowMapBuffer() [3/3]

mage::rendering::ShadowMapBuffer::ShadowMapBuffer ( ShadowMapBuffer &&  buffer)
defaultnoexcept

◆ ~ShadowMapBuffer()

mage::rendering::ShadowMapBuffer::~ShadowMapBuffer ( )
default

Member Function Documentation

◆ Bind()

void mage::rendering::ShadowMapBuffer::Bind ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindDSV()

void mage::rendering::ShadowMapBuffer::BindDSV ( ID3D11DeviceContext &  device_context,
std::size_t  dsv_index 
) const
noexcept

◆ BindRasterizerState()

void mage::rendering::ShadowMapBuffer::BindRasterizerState ( ID3D11DeviceContext &  device_context) const
noexcept

◆ ClearDSVs()

void mage::rendering::ShadowMapBuffer::ClearDSVs ( ID3D11DeviceContext &  device_context) const
noexcept

◆ GetDSV()

ID3D11DepthStencilView& mage::rendering::ShadowMapBuffer::GetDSV ( std::size_t  dsv_index) const
noexcept

◆ GetNumberOfShadowMaps()

std::size_t mage::rendering::ShadowMapBuffer::GetNumberOfShadowMaps ( ) const
noexcept

◆ GetSRV()

ID3D11ShaderResourceView& mage::rendering::ShadowMapBuffer::GetSRV ( ) const
noexcept

◆ operator=() [1/2]

ShadowMapBuffer& mage::rendering::ShadowMapBuffer::operator= ( const ShadowMapBuffer buffer)
delete

◆ operator=() [2/2]

ShadowMapBuffer & mage::rendering::ShadowMapBuffer::operator= ( ShadowMapBuffer &&  buffer)
defaultnoexcept

◆ SetupRasterizerState()

void mage::rendering::ShadowMapBuffer::SetupRasterizerState ( ID3D11Device &  device)
private

◆ SetupShadowMapArray()

void mage::rendering::ShadowMapBuffer::SetupShadowMapArray ( ID3D11Device &  device,
std::size_t  nb_shadow_maps,
DXGI_FORMAT  texture_format,
DXGI_FORMAT  dsv_format,
DXGI_FORMAT  srv_format 
)
private

◆ SetupShadowMapBuffer()

void mage::rendering::ShadowMapBuffer::SetupShadowMapBuffer ( ID3D11Device &  device,
std::size_t  nb_shadow_maps 
)
private

Member Data Documentation

◆ m_dsvs

std::vector< ComPtr< ID3D11DepthStencilView > > mage::rendering::ShadowMapBuffer::m_dsvs
private

◆ m_format

DepthFormat mage::rendering::ShadowMapBuffer::m_format
private

◆ m_rasterizer_state

ComPtr< ID3D11RasterizerState > mage::rendering::ShadowMapBuffer::m_rasterizer_state
private

◆ m_srv

ComPtr< ID3D11ShaderResourceView > mage::rendering::ShadowMapBuffer::m_srv
private

◆ m_viewport

Viewport mage::rendering::ShadowMapBuffer::m_viewport
private