A LOD slot to potentially draw, within a group slot. More...
Public Member Functions | |
EntityRenderLodSlot () noexcept | |
EntityRenderLodSlot (Mesh *mesh, Shader *shader) noexcept | |
virtual | ~EntityRenderLodSlot () |
const BoundingBox & | getBounds () const |
Mesh * | getMesh () const |
Shader * | getShader () const |
Shader * | getRaytracingShader () const |
float | getQualityMetric () const |
Shader * | getActiveShader () const |
EntityRenderInfoSlot * | getParentSlot () const |
Entity * | getParentEntity () const |
void | setMesh (Mesh *value) |
void | setShader (Shader *value) |
void | setRaytracingShader (Shader *value) |
void | setQualityMetric (float value) |
void | setDirtyNodeTransform (bool value) |
void | meshBoundsUpdated () |
void | meshLayoutUpdated () |
bool | isCompatibleWith (Shader *shade) const |
void | updateActiveShader () |
virtual void | exportClassToTree (nkExport::Node *rootNode) override |
virtual void | importClassFromTree (nkExport::Node *rootNode) override |
Public Member Functions inherited from nkExport::Exportable | |
Exportable () noexcept | |
virtual | ~Exportable () |
A LOD slot to potentially draw, within a group slot.
This represents the end point in the rendering information, linking a mesh to a shader. The default render strategy will select one LOD to render, using provided information.
|
noexcept |
Default constructor.
Legacy convenience constructor.
mesh | The mesh to use. |
shader | The shader to use. |
|
virtual |
Destructor.
const BoundingBox& nkGraphics::EntityRenderLodSlot::getBounds | ( | ) | const |
Mesh* nkGraphics::EntityRenderLodSlot::getMesh | ( | ) | const |
Shader* nkGraphics::EntityRenderLodSlot::getShader | ( | ) | const |
Shader* nkGraphics::EntityRenderLodSlot::getRaytracingShader | ( | ) | const |
float nkGraphics::EntityRenderLodSlot::getQualityMetric | ( | ) | const |
Shader* nkGraphics::EntityRenderLodSlot::getActiveShader | ( | ) | const |
EntityRenderInfoSlot* nkGraphics::EntityRenderLodSlot::getParentSlot | ( | ) | const |
Entity* nkGraphics::EntityRenderLodSlot::getParentEntity | ( | ) | const |
void nkGraphics::EntityRenderLodSlot::setMesh | ( | Mesh * | value | ) |
Sets the mesh to use during rendering.
value | The mesh to use. |
void nkGraphics::EntityRenderLodSlot::setShader | ( | Shader * | value | ) |
Sets the shader to use during a RenderScenePass. This shader will be used, or not, depending on its compatibility with linked mesh.
value | The shader to use. |
void nkGraphics::EntityRenderLodSlot::setRaytracingShader | ( | Shader * | value | ) |
Sets the shader to use during a RaytracingPass.
value | The shader to use. |
void nkGraphics::EntityRenderLodSlot::setQualityMetric | ( | float | value | ) |
Sets the quality metric which can be used for LOD selection. This number can represent anything, but needs a meaning that can be interpreted by the RenderStrategy which will use it. For an exemple of how this could be interpreted, check the DefaultRenderStrategy.
value | The value to provide. |
void nkGraphics::EntityRenderLodSlot::setDirtyNodeTransform | ( | bool | value | ) |
Sets the transformation dirty flag. Used internally.
void nkGraphics::EntityRenderLodSlot::meshBoundsUpdated | ( | ) |
Notifies that the bounds have been udpated. Used internally.
void nkGraphics::EntityRenderLodSlot::meshLayoutUpdated | ( | ) |
Notifies that the mesh's layout has been updated. Used internally.
bool nkGraphics::EntityRenderLodSlot::isCompatibleWith | ( | Shader * | shade | ) | const |
shade | The shader to test against. |
void nkGraphics::EntityRenderLodSlot::updateActiveShader | ( | ) |
Updates the active shader used by the LOD, based on the active mesh and requested shader. If the requested shader is not compatible with the active mesh, then a compatible built-in shader will be chosen as active instead.
|
overridevirtual |
Exports an item into a tree describing its structure and its data.
rootNode | The node into which the object has to write its related information. |
Implements nkExport::Exportable.
|
overridevirtual |
Imports information from a tree which is supposed to describe its structure and data.
rootNode | The root node of the tree holding the information. |
Implements nkExport::Exportable.