Kanzi  3.9.4
Kanzi Engine API
kanzi::RenderEntry3D Class Reference

Host container for render states for 3D rendering. More...

#include <kanzi/core.ui/graphics3d/render_entry_3d.hpp>

Inheritance diagram for kanzi::RenderEntry3D:
[legend]

Public Types

using BindingRuntimeContainer = vector< AbstractBindingRuntimeSharedPtr >
 Binding runtime container. More...
 
using ReplacementBindingContainer = optional< vector< AbstractBindingSharedPtr > >
 Replacement binding container. More...
 
- Public Types inherited from kanzi::VariableBindingHost
using BindingRuntimeConstIterator = BindingRuntimeContainer::const_iterator
 Const iterator for binding runtimes. More...
 
using BindingRuntimeContainer = vector< AbstractBindingRuntimeSharedPtr >
 Binding runtime container. More...
 
using BindingRuntimeIterator = BindingRuntimeContainer::iterator
 Iterator for binding runtimes. More...
 
using BindingTargetMapping = flat_map< AbstractPropertyType, VariableBindingTargetRuntime * >
 Binding target mapping. More...
 

Public Member Functions

void applyFixedUniforms (Renderer3D &renderer)
 Apply fixed uniforms before rendering. More...
 
bool applyRenderState (Renderer3D &renderer)
 Apply the internal render state for rendering. More...
 
void bindGeometry (Renderer3D &renderer)
 Bind the contained geometry for rendering. More...
 
bool bindRenderState (Renderer3D &renderer)
 Bind the contained render state for rendering. More...
 
size_t getIndex () const
 Gets the associated index within the node. More...
 
MaterialSharedPtr getMaterial () const
 Gets the associated material. More...
 
MeshgetMesh () const
 Gets the associated mesh. More...
 
Node3DgetNode () const
 Gets the associated node. More...
 
RenderPassgetRenderPass ()
 Gets the associated node. More...
 
GlRenderStategetRenderState ()
 Gets the internal render state. More...
 
bool matches (const Node3D &node, size_t clusterIndex, MaterialSharedPtr material, Mesh *mesh)
 Tests if the render entry matches given settings. More...
 
void updateBindingsWithFixedUniformInputs ()
 Execute all bindings needing manual execution. More...
 
- Public Member Functions inherited from kanzi::VariableBindingHost
void addAvailableVariableSource (AbstractBindingVariableSource &variableSource)
 Add a variable source to the list of available sources. More...
 
void addBindingRuntime (AbstractBindingRuntimeSharedPtr bindingRuntime)
 Adds a binding runtime to the list of binding runtimes. More...
 
void addVariableTarget (VariableBindingTargetRuntime &targetRuntime)
 Adds variable binding target runtime into the variable host. More...
 
BindingRuntimeIterator beginBindingRuntimes ()
 Gets an iterator to the beginning of binding runtimes. More...
 
BindingRuntimeConstIterator beginBindingRuntimes () const
 Gets an iterator to the beginning of binding runtimes. More...
 
BindingRuntimeIterator endBindingRuntimes ()
 Gets an iterator to the end of binding runtimes. More...
 
BindingRuntimeConstIterator endBindingRuntimes () const
 Gets an iterator to the end of binding runtimes. More...
 
BindingRuntimeIterator endFixedRuntimes ()
 Gets an iterator to the end of fixed binding runtimes. More...
 
BindingRuntimeConstIterator endFixedRuntimes () const
 Gets an iterator to the end of fixed binding runtimes. More...
 
VariableBindingTargetRuntimegetVariableBindingTargetRuntime (AbstractPropertyType propertyType)
 Gets an existing variable binding target runtime based on a property type. More...
 
void removeAvailableVariableSource (AbstractBindingVariableSource &variableSource)
 Remove a variable source from the list of available sources. More...
 
void removeBindingRuntime (AbstractBindingRuntime &bindingRuntime)
 Removes a binding runtime. More...
 
void removeVariableTarget (VariableBindingTargetRuntime &targetRuntime)
 Removes a variable binding target from the variable host. More...
 
 ~VariableBindingHost ()
 Destructor. More...
 

Static Public Member Functions

static unique_ptr< RenderEntry3Dcreate (RenderPass &renderPass, Node3D &node, size_t index, MaterialSharedPtr material, Mesh *mesh)
 Creates a new render entry. More...
 

Protected Member Functions

void initializeRenderState (MaterialSharedPtr sharedMaterial)
 Initialize the internal state. More...
 
 RenderEntry3D (RenderPass &renderPass, Node3D &node, size_t index, MaterialSharedPtr material, Mesh *mesh)
 Constructor. More...
 

Protected Attributes

BindingRuntimeContainer::const_iterator m_endFixedRuntimes
 Iterator to the binding runtimes, to the last place there are fixed operations. More...
 
size_t m_index
 Source element (i.e. More...
 
Meshm_mesh
 Mesh being rendered. More...
 
Node3Dm_node
 Pointer to source node. More...
 
RenderPassm_renderPass
 Base render pass. More...
 
GlRenderState m_renderState
 Contained render state. More...
 

Detailed Description

Host container for render states for 3D rendering.

Used by render passes when drawing 3D objects. Contains the render state, references to associated node and render pass, and binding runtimes.

Since
Kanzi 3.9.0

Member Typedef Documentation

◆ BindingRuntimeContainer

◆ ReplacementBindingContainer

Replacement binding container.

Constructor & Destructor Documentation

◆ RenderEntry3D()

kanzi::RenderEntry3D::RenderEntry3D ( RenderPass renderPass,
Node3D node,
size_t  index,
MaterialSharedPtr  material,
Mesh mesh 
)
explicitprotected

Constructor.

Parameters
renderPassOwning render pass.
nodeNode associated.
indexIndex within the node.
materialMaterial associated.
meshMesh to use.
Since
Kanzi 3.9.1 constructor changed to explicit.

Member Function Documentation

◆ create()

static unique_ptr<RenderEntry3D> kanzi::RenderEntry3D::create ( RenderPass renderPass,
Node3D node,
size_t  index,
MaterialSharedPtr  material,
Mesh mesh 
)
static

Creates a new render entry.

Parameters
renderPassOwning render pass.
nodeNode associated.
indexIndex within the node.
materialMaterial associated.
meshMesh being rendered.

◆ updateBindingsWithFixedUniformInputs()

void kanzi::RenderEntry3D::updateBindingsWithFixedUniformInputs ( )

Execute all bindings needing manual execution.

Used internally by the binding functions.

◆ applyRenderState()

bool kanzi::RenderEntry3D::applyRenderState ( Renderer3D renderer)

Apply the internal render state for rendering.

Used internally by the binding functions.

Parameters
rendererRenderer to use.

◆ applyFixedUniforms()

void kanzi::RenderEntry3D::applyFixedUniforms ( Renderer3D renderer)

Apply fixed uniforms before rendering.

Used internally by the binding functions.

Parameters
rendererRenderer to use.

◆ bindRenderState()

bool kanzi::RenderEntry3D::bindRenderState ( Renderer3D renderer)

Bind the contained render state for rendering.

Applies any bindings needing manual execution, then binds the render state, then applies fixed uniforms. This does not bind the contained geometry for rendering.

Parameters
rendererRenderer to use.
Returns
True if the shader program to bind was bound correctly.

◆ bindGeometry()

void kanzi::RenderEntry3D::bindGeometry ( Renderer3D renderer)

Bind the contained geometry for rendering.

The contained render state should be bound before calling this function.

Parameters
rendererRenderer to use.

◆ matches()

bool kanzi::RenderEntry3D::matches ( const Node3D node,
size_t  clusterIndex,
MaterialSharedPtr  material,
Mesh mesh 
)

Tests if the render entry matches given settings.

Parameters
nodeNode to compare.
clusterIndexCluster index to compare.
materialMaterial to compare.
meshMesh to compare.

◆ getRenderPass()

RenderPass& kanzi::RenderEntry3D::getRenderPass ( )
inline

Gets the associated node.

Returned render pass cannot be invalid, since the association is owned by it.

Returns
Render pass.

◆ getNode()

Node3D* kanzi::RenderEntry3D::getNode ( ) const
inline

Gets the associated node.

Returns
Shared pointer to node. May be invalid if node has been destroyed.

◆ getIndex()

size_t kanzi::RenderEntry3D::getIndex ( ) const
inline

Gets the associated index within the node.

Returns
Index.

◆ getMaterial()

MaterialSharedPtr kanzi::RenderEntry3D::getMaterial ( ) const
inline

Gets the associated material.

Returns
material.

◆ getMesh()

Mesh* kanzi::RenderEntry3D::getMesh ( ) const
inline

Gets the associated mesh.

Returns
mesh.

◆ getRenderState()

GlRenderState& kanzi::RenderEntry3D::getRenderState ( )
inline

Gets the internal render state.

Returns
Reference to the render state.

◆ initializeRenderState()

void kanzi::RenderEntry3D::initializeRenderState ( MaterialSharedPtr  sharedMaterial)
protected

Initialize the internal state.

Attach render state to material. Create binding runtimes for render value bindings and attach them.

Parameters
sharedMaterialMaterial to attach to.

Member Data Documentation

◆ m_renderPass

RenderPass& kanzi::RenderEntry3D::m_renderPass
protected

Base render pass.

The render pass owns the association, so this reference can never be invalid.

◆ m_node

Node3D* kanzi::RenderEntry3D::m_node
protected

Pointer to source node.

If this pointer is marked as nullptr, the entry is invalid.

◆ m_index

size_t kanzi::RenderEntry3D::m_index
protected

Source element (i.e.

cluster) index for the node. Each renderable element or cluster has its own render state association.

◆ m_mesh

Mesh* kanzi::RenderEntry3D::m_mesh
protected

Mesh being rendered.

This member will be replaced with vertex- and index buffers and matrix palette in the future.

◆ m_renderState

GlRenderState kanzi::RenderEntry3D::m_renderState
protected

Contained render state.

◆ m_endFixedRuntimes

BindingRuntimeContainer::const_iterator kanzi::RenderEntry3D::m_endFixedRuntimes
protected

Iterator to the binding runtimes, to the last place there are fixed operations.


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