#include <kanzi/core.ui/graphics3d/material_renderer.hpp>
Public Member Functions | |
void | attach (MaterialSharedPtr material, Node3D &node) |
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, Mesh &mesh, KzcDynamicArray *transformedObjects) const |
Draw the given morph using attached material. More... | |
void | invalidateRenderValues () |
Mark all property notification handlers dirty. More... | |
GlRenderState & | getRenderState () |
Access render state. More... | |
MaterialSharedPtr | getMaterial () const |
Access brush. 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... | |
void | invalidateNotificationHandlers () |
Marks the notification handlers as invalid. More... | |
Static Public Member Functions | |
static unique_ptr< MaterialRenderer > | create () |
Constructor. More... | |
Protected Member Functions | |
MaterialRenderer () | |
Constructor. More... | |
bool | isChangeCounterSame (Material &material) const |
Check if property change counter matches that of the brush. More... | |
void | updateChangeCounter (Material &material) |
Update property change counter to match brush. 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 | ||
) |
void kanzi::MaterialRenderer::bind | ( | Renderer3D & | renderer | ) |
void kanzi::MaterialRenderer::draw | ( | Renderer3D & | renderer, |
Node3D & | node, | ||
Mesh & | mesh, | ||
KzcDynamicArray * | transformedObjects | ||
) | const |
Draw the given morph using attached material.
renderer | Renderer to use. |
node | The node being drawn. |
mesh | The mesh to draw. |
transformedObjects | List of transformed objects. |
void kanzi::MaterialRenderer::invalidateRenderValues | ( | ) |
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. |
|
inline |
Marks the notification handlers as invalid.
Use this function when you destroy a node before destroying the MaterialRenderer.
|
inlineprotected |
Check if property change counter matches that of the brush.
material | Material currently used. |
|
inlineprotected |
Update property change counter to match brush.
material | Material currently used. |