API Documentation
Public Member Functions | List of all members
nkGraphics::EntityRenderLodSlot Class Referencefinal

A LOD slot to potentially draw, within a group slot. More...

Inheritance diagram for nkGraphics::EntityRenderLodSlot:
nkExport::Exportable

Public Member Functions

 EntityRenderLodSlot () noexcept
 
 EntityRenderLodSlot (Mesh *mesh, Shader *shader) noexcept
 
virtual ~EntityRenderLodSlot ()
 
const BoundingBoxgetBounds () const
 
MeshgetMesh () const
 
ShadergetShader () const
 
ShadergetRaytracingShader () const
 
float getQualityMetric () const
 
ShadergetActiveShader () const
 
EntityRenderInfoSlotgetParentSlot () const
 
EntitygetParentEntity () 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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ EntityRenderLodSlot() [1/2]

nkGraphics::EntityRenderLodSlot::EntityRenderLodSlot ( )
noexcept

Default constructor.

◆ EntityRenderLodSlot() [2/2]

nkGraphics::EntityRenderLodSlot::EntityRenderLodSlot ( Mesh mesh,
Shader shader 
)
noexcept

Legacy convenience constructor.

Parameters
meshThe mesh to use.
shaderThe shader to use.

◆ ~EntityRenderLodSlot()

virtual nkGraphics::EntityRenderLodSlot::~EntityRenderLodSlot ( )
virtual

Destructor.

Member Function Documentation

◆ getBounds()

const BoundingBox& nkGraphics::EntityRenderLodSlot::getBounds ( ) const
Returns
The LOD's bounds, mix between the mesh itself and the node attached to the parent entity, if any.

◆ getMesh()

Mesh* nkGraphics::EntityRenderLodSlot::getMesh ( ) const
Returns
The mesh attached.

◆ getShader()

Shader* nkGraphics::EntityRenderLodSlot::getShader ( ) const
Returns
The shader wanted, when used in a RenderScenePass.
Remarks
This is the wanted shader for the LOD, which will be used or not depending on its compatibility with given mesh.

◆ getRaytracingShader()

Shader* nkGraphics::EntityRenderLodSlot::getRaytracingShader ( ) const
Returns
The raytracing shader used, when in a raytraced queue used in a RaytracingPass.

◆ getQualityMetric()

float nkGraphics::EntityRenderLodSlot::getQualityMetric ( ) const
Returns
The set quality metric.

◆ getActiveShader()

Shader* nkGraphics::EntityRenderLodSlot::getActiveShader ( ) const
Returns
The shader used, when used in a RenderScenePass.
Remarks
This is the shader marked as active, which will actually be used during rendering. Depending on the compatibility between the wanted shader and the mesh attached, this will return either the wanted shader (if compatible), or one of the component's compatible built-in shaders.

◆ getParentSlot()

EntityRenderInfoSlot* nkGraphics::EntityRenderLodSlot::getParentSlot ( ) const
Returns
The parent slot.

◆ getParentEntity()

Entity* nkGraphics::EntityRenderLodSlot::getParentEntity ( ) const
Returns
The parent entity.

◆ setMesh()

void nkGraphics::EntityRenderLodSlot::setMesh ( Mesh value)

Sets the mesh to use during rendering.

Parameters
valueThe mesh to use.

◆ setShader()

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.

Parameters
valueThe shader to use.

◆ setRaytracingShader()

void nkGraphics::EntityRenderLodSlot::setRaytracingShader ( Shader value)

Sets the shader to use during a RaytracingPass.

Parameters
valueThe shader to use.

◆ setQualityMetric()

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.

Parameters
valueThe value to provide.

◆ setDirtyNodeTransform()

void nkGraphics::EntityRenderLodSlot::setDirtyNodeTransform ( bool  value)

Sets the transformation dirty flag. Used internally.

◆ meshBoundsUpdated()

void nkGraphics::EntityRenderLodSlot::meshBoundsUpdated ( )

Notifies that the bounds have been udpated. Used internally.

◆ meshLayoutUpdated()

void nkGraphics::EntityRenderLodSlot::meshLayoutUpdated ( )

Notifies that the mesh's layout has been updated. Used internally.

◆ isCompatibleWith()

bool nkGraphics::EntityRenderLodSlot::isCompatibleWith ( Shader shade) const
Parameters
shadeThe shader to test against.
Returns
Whether the LOD, given its current state (its mesh currently), is compatible with the provided shader.

◆ updateActiveShader()

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.

◆ exportClassToTree()

virtual void nkGraphics::EntityRenderLodSlot::exportClassToTree ( nkExport::Node rootNode)
overridevirtual

Exports an item into a tree describing its structure and its data.

Parameters
rootNodeThe node into which the object has to write its related information.

Implements nkExport::Exportable.

◆ importClassFromTree()

virtual void nkGraphics::EntityRenderLodSlot::importClassFromTree ( nkExport::Node rootNode)
overridevirtual

Imports information from a tree which is supposed to describe its structure and data.

Parameters
rootNodeThe root node of the tree holding the information.

Implements nkExport::Exportable.


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