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

#include <forward_pass.hpp>

Public Member Functions

 ForwardPass (ID3D11Device &device, ID3D11DeviceContext &device_context, StateManager &state_manager, ResourceManager &resource_manager)
 
 ForwardPass (const ForwardPass &pass)=delete
 
 ForwardPass (ForwardPass &&pass) noexcept
 
 ~ForwardPass ()
 
ForwardPassoperator= (const ForwardPass &pass)=delete
 
ForwardPassoperator= (ForwardPass &&pass) noexcept
 
void XM_CALLCONV Render (const World &world, FXMMATRIX world_to_projection, BRDF brdf, bool vct) const
 
void XM_CALLCONV RenderSolid (const World &world, FXMMATRIX world_to_projection) const
 
void XM_CALLCONV RenderGBuffer (const World &world, FXMMATRIX world_to_projection) const
 
void XM_CALLCONV RenderEmissive (const World &world, FXMMATRIX world_to_projection) const
 
void XM_CALLCONV RenderTransparent (const World &world, FXMMATRIX world_to_projection, BRDF brdf, bool vct) const
 
void XM_CALLCONV RenderFalseColor (const World &world, FXMMATRIX world_to_projection, FalseColor false_color) const
 
void XM_CALLCONV RenderWireframe (const World &world, FXMMATRIX world_to_projection)
 

Private Member Functions

void BindFixedOpaqueState () const noexcept
 
void BindFixedTransparentState () const noexcept
 
void BindFixedWireframeState () const noexcept
 
void BindColor (const RGBA &color)
 
void XM_CALLCONV Render (const Model &model, FXMMATRIX world_to_projection) const noexcept
 

Private Attributes

std::reference_wrapper< ID3D11DeviceContext > m_device_context
 
std::reference_wrapper< StateManagerm_state_manager
 
std::reference_wrapper< ResourceManagerm_resource_manager
 
VertexShaderPtr m_vs
 
TexturePtr m_uv
 
ConstantBuffer< RGBAm_color_buffer
 

Detailed Description

A class of forward passes for performing light calculations.

Constructor & Destructor Documentation

◆ ForwardPass() [1/3]

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

Constructs a forward 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.

◆ ForwardPass() [2/3]

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

Constructs a forward pass from the given variable shading pass.

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

◆ ForwardPass() [3/3]

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

Constructs a forward pass by moving the given variable pass.

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

◆ ~ForwardPass()

mage::rendering::ForwardPass::~ForwardPass ( )
default

Destructs this forward pass.

Member Function Documentation

◆ BindColor()

void mage::rendering::ForwardPass::BindColor ( const RGBA color)
private

Binds the color data of this forward pass.

Parameters
[in]colorA reference to the color (in in linear space).
Exceptions
ExceptionFailed to bind the color data of this forward pass.

◆ BindFixedOpaqueState()

void mage::rendering::ForwardPass::BindFixedOpaqueState ( ) const
privatenoexcept

Binds the fixed opaque state of this forward pass.

◆ BindFixedTransparentState()

void mage::rendering::ForwardPass::BindFixedTransparentState ( ) const
privatenoexcept

Binds the fixed transparent state of this forward pass.

◆ BindFixedWireframeState()

void mage::rendering::ForwardPass::BindFixedWireframeState ( ) const
privatenoexcept

Binds the fixed wireframe state of this forward pass.

◆ operator=() [1/2]

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

Copies the given forward pass to this forward pass.

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

◆ operator=() [2/2]

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

Moves the given forward pass to this forward pass.

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

◆ Render() [1/2]

void XM_CALLCONV mage::rendering::ForwardPass::Render ( const World world,
FXMMATRIX  world_to_projection,
BRDF  brdf,
bool  vct 
) const

Renders the given world.

Parameters
[in]worldA reference to the world.
[in]world_to_projectionThe world-to-projection transformation matrix.
[in]brdfThe BRDF.
[in]vcttrue if voxel cone tracing should be enabled. false otherwise.
Exceptions
ExceptionFailed to render the world.

◆ Render() [2/2]

void XM_CALLCONV mage::rendering::ForwardPass::Render ( const Model model,
FXMMATRIX  world_to_projection 
) const
privatenoexcept

Renders the given model.

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

◆ RenderEmissive()

void XM_CALLCONV mage::rendering::ForwardPass::RenderEmissive ( const World world,
FXMMATRIX  world_to_projection 
) const

Renders the emissive models of the given world.

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

◆ RenderFalseColor()

void XM_CALLCONV mage::rendering::ForwardPass::RenderFalseColor ( const World world,
FXMMATRIX  world_to_projection,
FalseColor  false_color 
) const

Renders the given world as a false color.

Parameters
[in]worldA reference to the world.
[in]world_to_projectionThe world-to-projection transformation matrix.
[in]false_colorThe false color.
Exceptions
ExceptionFailed to render the world.

◆ RenderGBuffer()

void XM_CALLCONV mage::rendering::ForwardPass::RenderGBuffer ( const World world,
FXMMATRIX  world_to_projection 
) const

Renders the given world to a GBuffer.

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

◆ RenderSolid()

void XM_CALLCONV mage::rendering::ForwardPass::RenderSolid ( const World world,
FXMMATRIX  world_to_projection 
) const

Renders the given world as solid.

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

◆ RenderTransparent()

void XM_CALLCONV mage::rendering::ForwardPass::RenderTransparent ( const World world,
FXMMATRIX  world_to_projection,
BRDF  brdf,
bool  vct 
) const

Renders the transparent models of the given world.

Parameters
[in]worldA reference to the world.
[in]world_to_projectionThe world-to-projection transformation matrix.
[in]brdfThe BRDF.
[in]vcttrue if voxel cone tracing should be enabled. false otherwise.
Exceptions
ExceptionFailed to render the world.

◆ RenderWireframe()

void XM_CALLCONV mage::rendering::ForwardPass::RenderWireframe ( const World world,
FXMMATRIX  world_to_projection 
)

Renders the given world as a wireframe.

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

Member Data Documentation

◆ m_color_buffer

ConstantBuffer< RGBA > mage::rendering::ForwardPass::m_color_buffer
private

The color buffer of this forward pass.

◆ m_device_context

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

A reference to the device context of this forward pass.

◆ m_resource_manager

std::reference_wrapper< ResourceManager > mage::rendering::ForwardPass::m_resource_manager
private

A reference to the resource manager of this forward pass.

◆ m_state_manager

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

A reference to the state manager of this forward pass.

◆ m_uv

TexturePtr mage::rendering::ForwardPass::m_uv
private

A pointer to the UV reference texture of this forward pass.

◆ m_vs

VertexShaderPtr mage::rendering::ForwardPass::m_vs
private

A pointer to the vertex shader of this forward pass.