Castor3D 0.12.0
Multiplatform 3D engine
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
castor3d::RenderNodesPass Class Referenceabstract

#include <RenderNodesPass.hpp>

Inheritance diagram for castor3d::RenderNodesPass:
Inheritance graph
[legend]
Collaboration diagram for castor3d::RenderNodesPass:
Collaboration graph
[legend]

Classes

struct  PassDescriptors
 

Public Member Functions

C3D_API ~RenderNodesPass () override
 Destructor. More...
 
virtual C3D_API void update (CpuUpdater &updater)
 Updates the render pass, CPU wise. More...
 
virtual C3D_API void update (GpuUpdater &updater)
 Updates the render pass, GPU wise. More...
 
C3D_API ShaderPtr getVertexShaderSource (PipelineFlags const &flags) const
 Retrieves the vertex shader source matching the given flags. More...
 
C3D_API ShaderPtr getHullShaderSource (PipelineFlags const &flags) const
 Retrieves the hull shader source matching the given flags. More...
 
C3D_API ShaderPtr getDomainShaderSource (PipelineFlags const &flags) const
 Retrieves the domain shader source matching the given flags. More...
 
C3D_API ShaderPtr getGeometryShaderSource (PipelineFlags const &flags) const
 Retrieves the geometry shader source matching the given flags. More...
 
C3D_API ShaderPtr getPixelShaderSource (PipelineFlags const &flags) const
 Retrieves the pixel shader source matching the given flags. More...
 
C3D_API PassFlags adjustFlags (PassFlags flags) const
 Adjusts given flags to match the render pass requirements. More...
 
C3D_API ProgramFlags adjustFlags (ProgramFlags flags) const
 Adjusts given flags to match the render pass requirements. More...
 
C3D_API SceneFlags adjustFlags (SceneFlags flags) const
 Adjusts given flags to match the render pass requirements. More...
 
C3D_API PipelineFlags createPipelineFlags (BlendMode colourBlendMode, BlendMode alphaBlendMode, PassFlags passFlags, RenderPassTypeID renderPassTypeID, PassTypeID passTypeID, uint32_t heightTextureIndex, VkCompareOp alphaFunc, VkCompareOp blendAlphaFunc, TextureFlagsArray const &textures, ProgramFlags const &programFlags, SceneFlags const &sceneFlags, VkPrimitiveTopology topology, bool isFrontCulled)
 Creates the pipeline flags for given configuration. More...
 
C3D_API PipelineFlags createPipelineFlags (Pass const &pass, TextureFlagsArray const &textures, ProgramFlags const &programFlags, SceneFlags const &sceneFlags, VkPrimitiveTopology topology, bool isFrontCulled)
 Creates the pipeline flags for given configuration. More...
 
C3D_API RenderPipelineprepareBackPipeline (PipelineFlags pipelineFlags, ashes::PipelineVertexInputStateCreateInfoCRefArray const &vertexLayouts)
 Prepares the pipeline matching the given flags, for back face culling nodes. More...
 
C3D_API RenderPipelineprepareFrontPipeline (PipelineFlags pipelineFlags, ashes::PipelineVertexInputStateCreateInfoCRefArray const &vertexLayouts)
 Prepares the pipeline matching the given flags, for front face culling nodes. More...
 
C3D_API void initialiseAdditionalDescriptor (RenderPipeline &pipeline, ShadowMapLightTypeArray const &shadowMaps)
 Initialises the additional descriptor set of a billboard node. More...
 
C3D_API FilteredTextureFlags filterTexturesFlags (TextureFlagsArray const &textures) const
 Filters the given textures flags using this pass needed textures. More...
 
C3D_API void setIgnoredNode (SceneNode const &node)
 Sets the node ignored node. More...
 
virtual C3D_API TextureFlags getTexturesMask () const
 
C3D_API bool isValidPass (Pass const &pass) const
 
C3D_API bool isValidRenderable (RenderedObject const &object) const
 
C3D_API bool hasNodes () const
 
C3D_API bool isPassEnabled () const
 
C3D_API ScenegetScene () const
 
C3D_API SceneNode const * getIgnoredNode () const
 
virtual C3D_API ShaderFlags getShaderFlags () const
 
bool isOrderIndependent () const
 
SceneCuller const & getCuller () const
 
SceneCullergetCuller ()
 
SceneUbogetSceneUbo ()
 
SceneUbo const & getSceneUbo () const
 
MatrixUbogetMatrixUbo () const
 
uint32_t getPipelinesCount () const
 
bool isDirty () const
 
bool forceTwoSided () const
 
RenderMode getRenderMode () const
 
castor::String const & getTypeName () const
 
RenderPassTypeID getTypeID () const
 

Static Public Member Functions

static C3D_API ashes::PipelineColorBlendStateCreateInfo createBlendState (BlendMode colourBlendMode, BlendMode alphaBlendMode, uint32_t attachesCount)
 Creates a blend state matching given blend modes. More...
 

Protected Member Functions

C3D_API RenderNodesPass (crg::FramePass const &pass, crg::GraphContext &context, crg::RunnableGraph &graph, RenderDevice const &device, castor::String const &typeName, castor::String const &category, castor::String const &name, RenderNodesPassDesc const &desc)
 Constructor. More...
 
C3D_API void doUpdate (SubmeshRenderNodesPtrByPipelineMap &nodes)
 Updates instantiated submeshes. More...
 
C3D_API void doUpdate (SubmeshRenderNodesPtrByPipelineMap &nodes, RenderInfo &info)
 Updates instantiated submeshes. More...
 
C3D_API void doUpdate (SubmeshRenderNodePtrByPipelineMap &nodes)
 Updates non instantiated submeshes. More...
 
C3D_API void doUpdate (SubmeshRenderNodePtrByPipelineMap &nodes, RenderInfo &info)
 Updates non instantiated submeshes. More...
 
C3D_API void doUpdate (BillboardRenderNodePtrByPipelineMap &nodes)
 Updates billboards. More...
 
C3D_API void doUpdate (BillboardRenderNodePtrByPipelineMap &nodes, RenderInfo &info)
 Updates billboards. More...
 
virtual C3D_API void doUpdate (RenderQueueArray &queues)
 Updates the specific data. More...
 
virtual C3D_API void doUpdateUbos (CpuUpdater &updater)
 Updates the render pass, CPU wise. More...
 
virtual C3D_API void doFillAdditionalBindings (ashes::VkDescriptorSetLayoutBindingArray &bindings) const =0
 Fills the render pass specific descriptor layout bindings. More...
 
virtual C3D_API bool doAreValidPassFlags (PassFlags const &passFlags) const
 
virtual C3D_API bool doIsValidPass (Pass const &pass) const
 
virtual C3D_API bool doIsValidRenderable (RenderedObject const &object) const
 
virtual C3D_API PassFlags doAdjustPassFlags (PassFlags flags) const
 
virtual C3D_API ProgramFlags doAdjustProgramFlags (ProgramFlags flags) const
 
virtual C3D_API SceneFlags doAdjustSceneFlags (SceneFlags flags) const
 
C3D_API ShaderProgramSPtr doGetProgram (PipelineFlags const &flags, VkCullModeFlags cullMode=VK_CULL_MODE_NONE)
 

Protected Attributes

RenderDevice const & m_device
 
RenderSystemm_renderSystem
 
MatrixUbom_matrixUbo
 
SceneCullerm_culler
 
castor::String m_typeName
 
RenderPassTypeID m_typeID {}
 
RenderQueueUPtr m_renderQueue
 
castor::String m_category
 
castor::Size m_size
 
RenderMode m_mode { RenderMode::eBoth }
 
bool m_oit { false }
 
bool m_forceTwoSided { false }
 
bool m_safeBand { false }
 
bool m_isDirty { true }
 
SceneUbo m_sceneUbo
 
uint32_t m_index { 0u }
 
std::array< PassDescriptors, size_t(RenderNodeType::eCount) > m_additionalDescriptors
 

Constructor & Destructor Documentation

◆ RenderNodesPass()

C3D_API castor3d::RenderNodesPass::RenderNodesPass ( crg::FramePass const &  pass,
crg::GraphContext &  context,
crg::RunnableGraph &  graph,
RenderDevice const &  device,
castor::String const &  typeName,
castor::String const &  category,
castor::String const &  name,
RenderNodesPassDesc const &  desc 
)
protected

Constructor.

Parameters
[in]passThe parent frame pass.
[in]contextThe rendering context.
[in]graphThe runnable graph.
[in]deviceThe GPU device.
[in]typeNameThe pass type name.
[in]categoryThe pass category.
[in]nameThe pass name.
[in]descThe construction data.

◆ ~RenderNodesPass()

C3D_API castor3d::RenderNodesPass::~RenderNodesPass ( )
override

Destructor.

Member Function Documentation

◆ adjustFlags() [1/3]

C3D_API PassFlags castor3d::RenderNodesPass::adjustFlags ( PassFlags  flags) const

Adjusts given flags to match the render pass requirements.

Parameters
[in]flagsThe flags.

◆ adjustFlags() [2/3]

C3D_API ProgramFlags castor3d::RenderNodesPass::adjustFlags ( ProgramFlags  flags) const

Adjusts given flags to match the render pass requirements.

Parameters
[in]flagsThe flags.

◆ adjustFlags() [3/3]

C3D_API SceneFlags castor3d::RenderNodesPass::adjustFlags ( SceneFlags  flags) const

Adjusts given flags to match the render pass requirements.

Parameters
[in]flagsThe flags.

◆ createBlendState()

static C3D_API ashes::PipelineColorBlendStateCreateInfo castor3d::RenderNodesPass::createBlendState ( BlendMode  colourBlendMode,
BlendMode  alphaBlendMode,
uint32_t  attachesCount 
)
static

Creates a blend state matching given blend modes.

Parameters
[in]colourBlendModeThe colour blend mode.
[in]alphaBlendModeThe alpha blend mode.
[in]attachesCountThe wanted blend attaches count.
Returns

◆ createPipelineFlags() [1/2]

C3D_API PipelineFlags castor3d::RenderNodesPass::createPipelineFlags ( BlendMode  colourBlendMode,
BlendMode  alphaBlendMode,
PassFlags  passFlags,
RenderPassTypeID  renderPassTypeID,
PassTypeID  passTypeID,
uint32_t  heightTextureIndex,
VkCompareOp  alphaFunc,
VkCompareOp  blendAlphaFunc,
TextureFlagsArray const &  textures,
ProgramFlags const &  programFlags,
SceneFlags const &  sceneFlags,
VkPrimitiveTopology  topology,
bool  isFrontCulled 
)

Creates the pipeline flags for given configuration.

Parameters
[in]colourBlendModeThe colour blending mode.
[in]alphaBlendModeThe alpha blending mode.
[in]passFlagsThe pass flags.
[in]renderPassTypeIDThe render pass type ID.
[in]passTypeIDThe material pass type ID.
[in]heightTextureIndexThe height map index (if any).
[in]alphaFuncThe alpha comparison function (for opaque nodes).
[in]blendAlphaFuncThe alpha comparison function (for transparent nodes).
[in]texturesThe textures configuration.
[in]programFlagsA combination of ProgramFlag.
[in]sceneFlagsScene related flags.
[in]topologyThe render topology.
[in]isFrontCulledtrue for front face culling, false for back face culling.

◆ createPipelineFlags() [2/2]

C3D_API PipelineFlags castor3d::RenderNodesPass::createPipelineFlags ( Pass const &  pass,
TextureFlagsArray const &  textures,
ProgramFlags const &  programFlags,
SceneFlags const &  sceneFlags,
VkPrimitiveTopology  topology,
bool  isFrontCulled 
)

Creates the pipeline flags for given configuration.

Parameters
[in]passThe pass for whic the pipeline is created.
[in]texturesThe textures configuration.
[in]programFlagsA combination of ProgramFlag.
[in]sceneFlagsScene related flags.
[in]topologyThe render topology.
[in]isFrontCulledtrue for front face culling, false for back face culling.

◆ doAdjustPassFlags()

virtual C3D_API PassFlags castor3d::RenderNodesPass::doAdjustPassFlags ( PassFlags  flags) const
protectedvirtual

◆ doAdjustProgramFlags()

virtual C3D_API ProgramFlags castor3d::RenderNodesPass::doAdjustProgramFlags ( ProgramFlags  flags) const
protectedvirtual

Reimplemented in castor3d::RenderTechniquePass.

◆ doAdjustSceneFlags()

virtual C3D_API SceneFlags castor3d::RenderNodesPass::doAdjustSceneFlags ( SceneFlags  flags) const
protectedvirtual

Reimplemented in castor3d::RenderTechniquePass.

◆ doAreValidPassFlags()

virtual C3D_API bool castor3d::RenderNodesPass::doAreValidPassFlags ( PassFlags const &  passFlags) const
protectedvirtual

◆ doFillAdditionalBindings()

virtual C3D_API void castor3d::RenderNodesPass::doFillAdditionalBindings ( ashes::VkDescriptorSetLayoutBindingArray &  bindings) const
protectedpure virtual

Fills the render pass specific descriptor layout bindings.

Parameters
[in,out]bindingsReceives the additional bindings.

◆ doGetProgram()

C3D_API ShaderProgramSPtr castor3d::RenderNodesPass::doGetProgram ( PipelineFlags const &  flags,
VkCullModeFlags  cullMode = VK_CULL_MODE_NONE 
)
protected

◆ doIsValidPass()

virtual C3D_API bool castor3d::RenderNodesPass::doIsValidPass ( Pass const &  pass) const
protectedvirtual

◆ doIsValidRenderable()

virtual C3D_API bool castor3d::RenderNodesPass::doIsValidRenderable ( RenderedObject const &  object) const
protectedvirtual

◆ doUpdate() [1/7]

C3D_API void castor3d::RenderNodesPass::doUpdate ( BillboardRenderNodePtrByPipelineMap nodes)
protected

Updates billboards.

Parameters
[in]nodesThe render nodes.

◆ doUpdate() [2/7]

C3D_API void castor3d::RenderNodesPass::doUpdate ( BillboardRenderNodePtrByPipelineMap nodes,
RenderInfo info 
)
protected

Updates billboards.

Parameters
[in]nodesThe render nodes.
[in,out]infoReceives the render informations.

◆ doUpdate() [3/7]

virtual C3D_API void castor3d::RenderNodesPass::doUpdate ( RenderQueueArray queues)
protectedvirtual

Updates the specific data.

Remarks
Gather the render queues, for further update.
Parameters
[out]queuesReceives the render queues needed for the rendering of the frame.

◆ doUpdate() [4/7]

C3D_API void castor3d::RenderNodesPass::doUpdate ( SubmeshRenderNodePtrByPipelineMap nodes)
protected

Updates non instantiated submeshes.

Parameters
[in]nodesThe render nodes.

◆ doUpdate() [5/7]

C3D_API void castor3d::RenderNodesPass::doUpdate ( SubmeshRenderNodePtrByPipelineMap nodes,
RenderInfo info 
)
protected

Updates non instantiated submeshes.

Parameters
[in]nodesThe render nodes.
[in,out]infoReceives the render informations.

◆ doUpdate() [6/7]

C3D_API void castor3d::RenderNodesPass::doUpdate ( SubmeshRenderNodesPtrByPipelineMap nodes)
protected

Updates instantiated submeshes.

Parameters
[in]nodesThe render nodes.

◆ doUpdate() [7/7]

C3D_API void castor3d::RenderNodesPass::doUpdate ( SubmeshRenderNodesPtrByPipelineMap nodes,
RenderInfo info 
)
protected

Updates instantiated submeshes.

Parameters
[in]nodesThe render nodes.
[in,out]infoReceives the render informations.

◆ doUpdateUbos()

virtual C3D_API void castor3d::RenderNodesPass::doUpdateUbos ( CpuUpdater updater)
protectedvirtual

Updates the render pass, CPU wise.

Parameters
[in,out]updaterThe update data.

Reimplemented in castor3d::RenderTechniquePass.

◆ filterTexturesFlags()

C3D_API FilteredTextureFlags castor3d::RenderNodesPass::filterTexturesFlags ( TextureFlagsArray const &  textures) const

Filters the given textures flags using this pass needed textures.

Parameters
[in]texturesThe textures flags.
Returns
The filtered flags.

◆ forceTwoSided()

bool castor3d::RenderNodesPass::forceTwoSided ( ) const
inline

References m_forceTwoSided.

◆ getCuller() [1/2]

SceneCuller & castor3d::RenderNodesPass::getCuller ( )
inline

References m_culler.

◆ getCuller() [2/2]

SceneCuller const & castor3d::RenderNodesPass::getCuller ( ) const
inline

References m_culler.

◆ getDomainShaderSource()

C3D_API ShaderPtr castor3d::RenderNodesPass::getDomainShaderSource ( PipelineFlags const &  flags) const

Retrieves the domain shader source matching the given flags.

Parameters
[in]flagsThe pipeline flags.

◆ getGeometryShaderSource()

C3D_API ShaderPtr castor3d::RenderNodesPass::getGeometryShaderSource ( PipelineFlags const &  flags) const

Retrieves the geometry shader source matching the given flags.

Parameters
[in]flagsThe pipeline flags.

◆ getHullShaderSource()

C3D_API ShaderPtr castor3d::RenderNodesPass::getHullShaderSource ( PipelineFlags const &  flags) const

Retrieves the hull shader source matching the given flags.

Parameters
[in]flagsThe pipeline flags.

◆ getIgnoredNode()

C3D_API SceneNode const * castor3d::RenderNodesPass::getIgnoredNode ( ) const

◆ getMatrixUbo()

MatrixUbo & castor3d::RenderNodesPass::getMatrixUbo ( ) const
inline

References m_matrixUbo.

◆ getPipelinesCount()

uint32_t castor3d::RenderNodesPass::getPipelinesCount ( ) const
inline

◆ getPixelShaderSource()

C3D_API ShaderPtr castor3d::RenderNodesPass::getPixelShaderSource ( PipelineFlags const &  flags) const

Retrieves the pixel shader source matching the given flags.

Parameters
[in]flagsThe pipeline flags.

◆ getRenderMode()

RenderMode castor3d::RenderNodesPass::getRenderMode ( ) const
inline

References m_mode.

◆ getScene()

C3D_API Scene & castor3d::RenderNodesPass::getScene ( ) const

◆ getSceneUbo() [1/2]

SceneUbo & castor3d::RenderNodesPass::getSceneUbo ( )
inline

References m_sceneUbo.

◆ getSceneUbo() [2/2]

SceneUbo const & castor3d::RenderNodesPass::getSceneUbo ( ) const
inline

References m_sceneUbo.

◆ getShaderFlags()

virtual C3D_API ShaderFlags castor3d::RenderNodesPass::getShaderFlags ( ) const
inlinevirtual

◆ getTexturesMask()

virtual C3D_API TextureFlags castor3d::RenderNodesPass::getTexturesMask ( ) const
virtual

◆ getTypeID()

RenderPassTypeID castor3d::RenderNodesPass::getTypeID ( ) const
inline

References m_typeID.

◆ getTypeName()

castor::String const & castor3d::RenderNodesPass::getTypeName ( ) const
inline

References m_typeName.

◆ getVertexShaderSource()

C3D_API ShaderPtr castor3d::RenderNodesPass::getVertexShaderSource ( PipelineFlags const &  flags) const

Retrieves the vertex shader source matching the given flags.

Parameters
[in]flagsThe pipeline flags.

◆ hasNodes()

C3D_API bool castor3d::RenderNodesPass::hasNodes ( ) const

◆ initialiseAdditionalDescriptor()

C3D_API void castor3d::RenderNodesPass::initialiseAdditionalDescriptor ( RenderPipeline pipeline,
ShadowMapLightTypeArray const &  shadowMaps 
)

Initialises the additional descriptor set of a billboard node.

Parameters
[in]pipelineThe render pipeline.
[in]shadowMapsThe shadow maps.

◆ isDirty()

bool castor3d::RenderNodesPass::isDirty ( ) const
inline

References m_isDirty.

◆ isOrderIndependent()

bool castor3d::RenderNodesPass::isOrderIndependent ( ) const
inline

References m_oit.

◆ isPassEnabled()

C3D_API bool castor3d::RenderNodesPass::isPassEnabled ( ) const

◆ isValidPass()

C3D_API bool castor3d::RenderNodesPass::isValidPass ( Pass const &  pass) const

◆ isValidRenderable()

C3D_API bool castor3d::RenderNodesPass::isValidRenderable ( RenderedObject const &  object) const

◆ prepareBackPipeline()

C3D_API RenderPipeline & castor3d::RenderNodesPass::prepareBackPipeline ( PipelineFlags  pipelineFlags,
ashes::PipelineVertexInputStateCreateInfoCRefArray const &  vertexLayouts 
)

Prepares the pipeline matching the given flags, for back face culling nodes.

Parameters
[in]pipelineFlagsThe pipeline flags.
[in]vertexLayoutsThe vertex buffers layouts.

◆ prepareFrontPipeline()

C3D_API RenderPipeline & castor3d::RenderNodesPass::prepareFrontPipeline ( PipelineFlags  pipelineFlags,
ashes::PipelineVertexInputStateCreateInfoCRefArray const &  vertexLayouts 
)

Prepares the pipeline matching the given flags, for front face culling nodes.

Parameters
[in]pipelineFlagsThe pipeline flags.
[in]vertexLayoutsThe vertex buffers layouts.

◆ setIgnoredNode()

C3D_API void castor3d::RenderNodesPass::setIgnoredNode ( SceneNode const &  node)

Sets the node ignored node.

Remarks
All objects attached to this node will be ignored during rendering.
Parameters
[in]nodeThe node.

◆ update() [1/2]

virtual C3D_API void castor3d::RenderNodesPass::update ( CpuUpdater updater)
virtual

Updates the render pass, CPU wise.

Parameters
[in,out]updaterThe update data.

Reimplemented in castor3d::RenderTechniquePass, castor3d::VoxelizePass, castor3d::ShadowMapPassDirectional, castor3d::ShadowMapPassPoint, and castor3d::ShadowMapPassSpot.

◆ update() [2/2]

virtual C3D_API void castor3d::RenderNodesPass::update ( GpuUpdater updater)
virtual

Member Data Documentation

◆ m_additionalDescriptors

std::array< PassDescriptors, size_t( RenderNodeType::eCount ) > castor3d::RenderNodesPass::m_additionalDescriptors
protected

◆ m_category

castor::String castor3d::RenderNodesPass::m_category
protected

◆ m_culler

SceneCuller& castor3d::RenderNodesPass::m_culler
protected

Referenced by getCuller().

◆ m_device

RenderDevice const& castor3d::RenderNodesPass::m_device
protected

◆ m_forceTwoSided

bool castor3d::RenderNodesPass::m_forceTwoSided { false }
protected

Referenced by forceTwoSided().

◆ m_index

uint32_t castor3d::RenderNodesPass::m_index { 0u }
protected

◆ m_isDirty

bool castor3d::RenderNodesPass::m_isDirty { true }
protected

Referenced by isDirty().

◆ m_matrixUbo

MatrixUbo& castor3d::RenderNodesPass::m_matrixUbo
protected

Referenced by getMatrixUbo().

◆ m_mode

RenderMode castor3d::RenderNodesPass::m_mode { RenderMode::eBoth }
protected

Referenced by getRenderMode().

◆ m_oit

bool castor3d::RenderNodesPass::m_oit { false }
protected

Referenced by isOrderIndependent().

◆ m_renderQueue

RenderQueueUPtr castor3d::RenderNodesPass::m_renderQueue
protected

◆ m_renderSystem

RenderSystem& castor3d::RenderNodesPass::m_renderSystem
protected

◆ m_safeBand

bool castor3d::RenderNodesPass::m_safeBand { false }
protected

◆ m_sceneUbo

SceneUbo castor3d::RenderNodesPass::m_sceneUbo
protected

Referenced by getSceneUbo().

◆ m_size

castor::Size castor3d::RenderNodesPass::m_size
protected

◆ m_typeID

RenderPassTypeID castor3d::RenderNodesPass::m_typeID {}
protected

Referenced by getTypeID().

◆ m_typeName

castor::String castor3d::RenderNodesPass::m_typeName
protected

Referenced by getTypeName().


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