#include <kanzi/core.ui/graphics3d/material_renderer.hpp>
Public Member Functions | |
void | attach (MaterialSharedPtr material, Node3D &node, Mesh *mesh) |
Reattaches material renderer to a model and a mesh. More... | |
void | bind (Renderer3D &renderer) |
Bind material renderer for rendering. More... | |
void | draw (Renderer3D &renderer, Node3D &node, KzcDynamicArray *transformedObjects) const |
Draw the given morph using attached material. More... | |
void | setAllPropertiesDirty () |
Mark all property notification handlers dirty. More... | |
GlRenderState & | getRenderState () |
Access render state. More... | |
MaterialSharedPtr | getMaterial () const |
Access brush. More... | |
Mesh * | getMesh () const |
Access mesh. More... | |
bool | isRenderable () const |
Tells if this material renderer can be used for rendering. More... | |
GlRenderState::HandleType | getTextureHandle (string_view name) |
Get texture handle for contained render state. More... | |
GlRenderState::HandleType | getContentTextureHandle () |
Get content texture handle for contained render state. More... | |
void | setTextureValue (GlRenderState::HandleType handle, TextureSharedPtr value) |
Set texture value in contained render state. More... | |
Static Public Member Functions | |
static unique_ptr< MaterialRenderer > | create () |
Constructor. More... | |
Protected Member Functions | |
MaterialRenderer () | |
Constructor. More... | |
Material renderer.
Connects material, mesh and 3D node like a brush renderer connects material, brush and 2D node.
|
inlineexplicitprotected |
|
static |
Constructor.
node | Node to attach to. |
void kanzi::MaterialRenderer::attach | ( | MaterialSharedPtr | material, |
Node3D & | node, | ||
Mesh * | mesh | ||
) |
void kanzi::MaterialRenderer::bind | ( | Renderer3D & | renderer | ) |
void kanzi::MaterialRenderer::draw | ( | Renderer3D & | renderer, |
Node3D & | node, | ||
KzcDynamicArray * | transformedObjects | ||
) | const |
Draw the given morph using attached material.
renderer | Renderer to use. |
transformedObjects | List of transformed objects. |
cluster | Cluster of the mesh to draw. |
void kanzi::MaterialRenderer::setAllPropertiesDirty | ( | ) |
Mark all property notification handlers dirty.
|
inline |
Access render state.
|
inline |
Access brush.
|
inline |
Tells if this material renderer can be used for rendering.
|
inline |
Get texture handle for contained render state.
name | Texture uniform name. |
|
inline |
Get content texture handle for contained render state.
This function is provided as a shorthand because access to content texture is a common use case.
|
inline |
Set texture value in contained render state.
A valid texture handle must have been acquired by getTextureHandle prior to calling this function.
handle | Handle to content texture. |
value | Texture value. |