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

#include <depth_pass.hpp>

Public Member Functions

 DepthPass (ID3D11Device &device, ID3D11DeviceContext &device_context, StateManager &state_manager, ResourceManager &resource_manager)
 
 DepthPass (const DepthPass &pass)=delete
 
 DepthPass (DepthPass &&pass) noexcept
 
 ~DepthPass ()
 
DepthPassoperator= (const DepthPass &pass)=delete
 
DepthPassoperator= (DepthPass &&pass) noexcept
 
void BindFixedState () const noexcept
 
void XM_CALLCONV Render (const World &world, FXMMATRIX world_to_camera, CXMMATRIX camera_to_projection)
 
void XM_CALLCONV RenderOccluders (const World &world, FXMMATRIX world_to_camera, CXMMATRIX camera_to_projection)
 

Private Member Functions

void BindOpaqueShaders () const noexcept
 
void BindTransparentShaders () const noexcept
 
void XM_CALLCONV BindCamera (FXMMATRIX world_to_camera, CXMMATRIX camera_to_projection)
 
void XM_CALLCONV RenderOpaque (const Model &model, FXMMATRIX world_to_projection) const noexcept
 
void XM_CALLCONV RenderTransparent (const Model &model, FXMMATRIX world_to_projection) const noexcept
 

Private Attributes

std::reference_wrapper< ID3D11DeviceContext > m_device_context
 
std::reference_wrapper< StateManagerm_state_manager
 
VertexShaderPtr m_opaque_vs
 
VertexShaderPtr m_transparent_vs
 
PixelShaderPtr m_transparent_ps
 
ConstantBuffer< SecondaryCameraBufferm_camera_buffer
 

Detailed Description

A class of depth passes for rendering models to a depth buffer only.

Constructor & Destructor Documentation

◆ DepthPass() [1/3]

mage::rendering::DepthPass::DepthPass ( ID3D11Device &  device,
ID3D11DeviceContext &  device_context,
StateManager state_manager,
ResourceManager resource_manager 
)
explicit

Constructs a depth pass.

Parameters
[in,out]deviceA reference to the device.
[in,out]device_contextA reference to the device context.
[in,out]state_managerA reference to the state manager.
[in,out]resource_managerA reference to the resource manager.

◆ DepthPass() [2/3]

mage::rendering::DepthPass::DepthPass ( const DepthPass pass)
delete

Constructs a depth pass from the given depth pass.

Parameters
[in]passA reference to the depth pass to copy.

◆ DepthPass() [3/3]

mage::rendering::DepthPass::DepthPass ( DepthPass &&  pass)
defaultnoexcept

Constructs a depth pass by moving the given depth pass.

Parameters
[in]passA reference to the depth pass to move.

◆ ~DepthPass()

mage::rendering::DepthPass::~DepthPass ( )
default

Destructs this depth pass.

Member Function Documentation

◆ BindCamera()

void XM_CALLCONV mage::rendering::DepthPass::BindCamera ( FXMMATRIX  world_to_camera,
CXMMATRIX  camera_to_projection 
)
private

Binds the camera of this depth pass.

Parameters
[in]world_to_cameraThe world-to-camera transformation matrix.
[in]camera_to_projectionThe camera-to-projection transformation matrix.
Exceptions
ExceptionFailed to bind the camera of this depth pass.

◆ BindFixedState()

void mage::rendering::DepthPass::BindFixedState ( ) const
noexcept

Binds the fixed state of this depth pass.

Exceptions
ExceptionFailed to bind the fixed state of this depth pass.

◆ BindOpaqueShaders()

void mage::rendering::DepthPass::BindOpaqueShaders ( ) const
privatenoexcept

Binds the shaders for opaque models.

◆ BindTransparentShaders()

void mage::rendering::DepthPass::BindTransparentShaders ( ) const
privatenoexcept

Binds the shaders for transparent models.

◆ operator=() [1/2]

DepthPass& mage::rendering::DepthPass::operator= ( const DepthPass pass)
delete

Copies the given depth pass to this depth pass.

Parameters
[in]passA reference to the depth pass to copy.
Returns
A reference to the copy of the given depth pass (i.e. this depth pass).

◆ operator=() [2/2]

DepthPass & mage::rendering::DepthPass::operator= ( DepthPass &&  pass)
defaultnoexcept

Moves the given depth pass to this depth pass.

Parameters
[in]passA reference to the depth pass to move.
Returns
A reference to the moved depth pass (i.e. this depth pass).

◆ Render()

void XM_CALLCONV mage::rendering::DepthPass::Render ( const World world,
FXMMATRIX  world_to_camera,
CXMMATRIX  camera_to_projection 
)

Renders the world.

Parameters
[in]worldA reference to the world.
[in]world_to_cameraThe world-to-camera transformation matrix.
[in]camera_to_projectionThe camera-to-projection transformation matrix.
Exceptions
ExceptionFailed to render the world.

◆ RenderOccluders()

void XM_CALLCONV mage::rendering::DepthPass::RenderOccluders ( const World world,
FXMMATRIX  world_to_camera,
CXMMATRIX  camera_to_projection 
)

Renders the occluders of the world.

Parameters
[in]worldA reference to the world.
[in]world_to_cameraThe world-to-camera transformation matrix.
[in]camera_to_projectionThe camera-to-projection transformation matrix.
Exceptions
ExceptionFailed to render the world.

◆ RenderOpaque()

void XM_CALLCONV mage::rendering::DepthPass::RenderOpaque ( const Model model,
FXMMATRIX  world_to_projection 
) const
privatenoexcept

Renders the given opaque model.

Parameters
[in]modelA reference to the opaque model.
[in]world_to_projectionThe world-to-projection transformation matrix.

◆ RenderTransparent()

void XM_CALLCONV mage::rendering::DepthPass::RenderTransparent ( const Model model,
FXMMATRIX  world_to_projection 
) const
privatenoexcept

Renders the given transparent model.

Parameters
[in]modelA reference to the transparent model.
[in]world_to_projectionThe world-to-projection transformation matrix.

Member Data Documentation

◆ m_camera_buffer

ConstantBuffer< SecondaryCameraBuffer > mage::rendering::DepthPass::m_camera_buffer
private

The camera buffer of this depth pass.

◆ m_device_context

std::reference_wrapper< ID3D11DeviceContext > mage::rendering::DepthPass::m_device_context
private

A reference to the device context of this depth pass.

◆ m_opaque_vs

VertexShaderPtr mage::rendering::DepthPass::m_opaque_vs
private

A pointer to the vertex shader of this depth pass.

◆ m_state_manager

std::reference_wrapper< StateManager > mage::rendering::DepthPass::m_state_manager
private

A reference to the state manager of this depth pass.

◆ m_transparent_ps

PixelShaderPtr mage::rendering::DepthPass::m_transparent_ps
private

A pointer to the pixel shader for transparent models of this depth pass.

◆ m_transparent_vs

VertexShaderPtr mage::rendering::DepthPass::m_transparent_vs
private

A pointer to the vertex shader for transparent models of this depth pass.