Kanzi 4.1.0
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]

Classes

class  MorphHandles
 Cached morph handles. More...
 

Public Types

using BindingRuntimeContainer
 Binding runtime container.
 
using ReplacementBindingContainer
 Replacement binding container.
 
- Public Types inherited from kanzi::VariableBindingHost
using BindingRuntimeConstIterator
 Const iterator for binding runtimes.
 
using BindingRuntimeContainer
 Binding runtime container.
 
using BindingRuntimeIterator
 Iterator for binding runtimes.
 
using BindingTargetMapping
 Binding target mapping.
 

Public Member Functions

void applyFixedUniforms (Renderer &renderer)
 Apply fixed uniforms before rendering.
 
bool applyRenderState (Renderer &renderer)
 Apply the internal render state for rendering.
 
bool bindRenderState (Renderer &renderer)
 Bind the contained render state for rendering.
 
void draw (Renderer &renderer)
 Draw the contained geometry.
 
size_t getIndex () const
 Gets the associated index within the node.
 
uintptr_t getMaterialComparisonValue () const
 Gets material comparison value for material sorting.
 
MeshgetMesh () const
 Gets the associated mesh.
 
const MorphHandlesgetMorphHandles () const
 Gets the morph handles structure.
 
float getSortingValue () const
 Gets the sorting value.
 
bool matches (const Node3D &node, size_t clusterIndex, MaterialSharedPtr material, Mesh *mesh)
 Tests if the render entry matches given settings.
 
void setSortingValue (float value)
 Sets the sorting value.
 
bool updateSortingCounter (size_t counter)
 Updates the sorting counter.
 
- Public Member Functions inherited from kanzi::GraphicsEntry
MaterialSharedPtr getMaterial () const
 Gets the associated material.
 
Node3DgetNode () const
 Gets the associated node.
 
RenderPassgetRenderPass ()
 Gets the associated render pass.
 
RenderStategetRenderState ()
 Gets the internal render state.
 
void initializeState (MaterialSharedPtr sharedMaterial)
 Initialize the state of the graphics entry.
 
- Public Member Functions inherited from kanzi::VariableBindingHost
void addAvailableVariableSource (AbstractBindingVariableSource &variableSource)
 Add a variable source to the list of available sources.
 
void addBindingRuntime (AbstractBindingRuntimeSharedPtr bindingRuntime)
 Adds a binding runtime to the list of binding runtimes.
 
void addVariableTarget (VariableBindingTargetRuntime &targetRuntime)
 Adds variable binding target runtime into the variable host.
 
BindingRuntimeIterator beginBindingRuntimes ()
 Gets an iterator to the beginning of binding runtimes.
 
BindingRuntimeConstIterator beginBindingRuntimes () const
 Gets an iterator to the beginning of binding runtimes.
 
BindingRuntimeIterator endBindingRuntimes ()
 Gets an iterator to the end of binding runtimes.
 
BindingRuntimeConstIterator endBindingRuntimes () const
 Gets an iterator to the end of binding runtimes.
 
BindingRuntimeIterator endFixedRuntimes ()
 Gets an iterator to the end of fixed binding runtimes.
 
BindingRuntimeConstIterator endFixedRuntimes () const
 Gets an iterator to the end of fixed binding runtimes.
 
VariableBindingTargetRuntimegetVariableBindingTargetRuntime (AbstractPropertyType propertyType)
 Gets an existing variable binding target runtime based on a property type.
 
void removeAvailableVariableSource (AbstractBindingVariableSource &variableSource)
 Remove a variable source from the list of available sources.
 
void removeBindingRuntime (AbstractBindingRuntime &bindingRuntime)
 Removes a binding runtime.
 
void removeVariableTarget (VariableBindingTargetRuntime &targetRuntime)
 Removes a variable binding target from the variable host.
 
 ~VariableBindingHost ()
 Destructor.
 

Static Public Member Functions

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

Protected Member Functions

void initializeRenderState (MaterialSharedPtr sharedMaterial)
 Initialize the internal state.
 
 RenderEntry3D (RenderPass &renderPass, Node3D &node, size_t index, MaterialSharedPtr material, Mesh *mesh)
 Constructor.
 
- Protected Member Functions inherited from kanzi::GraphicsEntry
 GraphicsEntry (RenderPass &renderPass, Node3D *node)
 Constructor.
 
void updateBindingsWithFixedUniformInputs ()
 Execute all bindings needing manual execution.
 

Protected Attributes

size_t m_index
 Source element (i.e.
 
Meshm_mesh
 Mesh being rendered.
 
MorphHandles m_morphHandles
 Morph handles for this render entry.
 
size_t m_sortingCounter
 Sorting counter for updating or not updating the value.
 
float m_sortingValue
 Sorting value for render entry sorting.
 
- Protected Attributes inherited from kanzi::GraphicsEntry
Node3Dm_node
 Pointer to source node.
 
RenderPassm_renderPass
 Base render pass.
 
RenderState m_renderState
 Contained render state.
 

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

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.

◆ applyRenderState()

bool kanzi::RenderEntry3D::applyRenderState ( Renderer & renderer)

Apply the internal render state for rendering.

Used internally by the binding functions.

Parameters
rendererRenderer to use.
Since
Kanzi 4.0.0 changed the type of the renderer parameter to Renderer&.

◆ applyFixedUniforms()

void kanzi::RenderEntry3D::applyFixedUniforms ( Renderer & renderer)

Apply fixed uniforms before rendering.

Used internally by the binding functions.

Parameters
rendererRenderer to use.
Since
Kanzi 4.0.0 changed the type of the renderer parameter to Renderer&.

◆ bindRenderState()

bool kanzi::RenderEntry3D::bindRenderState ( Renderer & 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.
Since
Kanzi 4.0.0 changed the type of the renderer parameter to Renderer&.

◆ draw()

void kanzi::RenderEntry3D::draw ( Renderer & renderer)

Draw the contained geometry.

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

Parameters
rendererRenderer to use.
Since
Kanzi 4.0.0
  • Changed the type of the renderer parameter to Renderer&.
  • Renamed to draw().

◆ 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.

◆ getIndex()

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

Gets the associated index within the node.

Returns
Index.

◆ getMaterialComparisonValue()

uintptr_t kanzi::RenderEntry3D::getMaterialComparisonValue ( ) const
inline

Gets material comparison value for material sorting.

Returns
Comparable material value.
Since
Kanzi 4.1.0

◆ getMesh()

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

Gets the associated mesh.

Returns
mesh.

◆ getMorphHandles()

const MorphHandles & kanzi::RenderEntry3D::getMorphHandles ( ) const
inline

Gets the morph handles structure.

Returns
Reference to the morph handles.
Since
Kanzi 3.9.7
Kanzi 4.0.0 renamed from acquireMorphHandles().

◆ getSortingValue()

float kanzi::RenderEntry3D::getSortingValue ( ) const
inline

Gets the sorting value.

Returns
Sorting value.
Since
Kanzi 4.1.0

◆ setSortingValue()

void kanzi::RenderEntry3D::setSortingValue ( float value)
inline

Sets the sorting value.

Parameters
valueNew sorting value.
Since
Kanzi 4.1.0

◆ updateSortingCounter()

bool kanzi::RenderEntry3D::updateSortingCounter ( size_t counter)
inline

Updates the sorting counter.

Parameters
counterNew counter value.
Returns
If the counter was updated and value needs recalculating true, false otherwise.
Since
Kanzi 4.1.0

◆ 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_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_morphHandles

MorphHandles kanzi::RenderEntry3D::m_morphHandles
protected

Morph handles for this render entry.

Kanzi creates the handles only if it renders the morph meshes using this entry.

Since
Kanzi 3.9.7
Kanzi 4.0.0 changed the type to MorphHandles.

◆ m_sortingValue

float kanzi::RenderEntry3D::m_sortingValue
protected

Sorting value for render entry sorting.

Since
Kanzi 4.1.0

◆ m_sortingCounter

size_t kanzi::RenderEntry3D::m_sortingCounter
protected

Sorting counter for updating or not updating the value.

Since
Kanzi 4.1.0

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