Skip to content

Renderable

Base class for scene nodes that can be drawn.

Renderable extends Node with the interface the renderer needs to issue a draw call: a Geometry, a Material, and bounding volumes used for visibility culling. It is the common base for all drawable node types, such as Mesh, InstancedMesh, and Sprite.

This class is not instantiated directly. Use one of the concrete renderable types, or derive from it to implement a custom drawable.

INFO

Derives from Node and inherits all public properties and methods.

Properties

cast_shadow bool

When true this object casts shadows onto shadow receivers.

cpp
bool cast_shadow {false};

frustum_culled bool

When true this object participates in view frustum culling.

cpp
bool frustum_culled {true};

receive_shadow bool

When true this object receives shadows from shadow casters.

cpp
bool receive_shadow {false};

Functions

BoundingBox() Box3 virtual

Returns the object's bounding box.

Defaults to the bounding box of the object's geometry. Subclasses override this when their effective bounds differ, such as InstancedMesh.

cpp
virtual Box3 Renderable::BoundingBox();

BoundingSphere() Sphere virtual

Returns the object's bounding sphere.

Defaults to the bounding sphere of the object's geometry. Subclasses override this when their effective bounds differ.

cpp
virtual Sphere Renderable::BoundingSphere();

GetGeometry() std::shared_ptr<Geometry> pure virtual

Returns the geometry used to draw this object.

cpp
virtual std::shared_ptr<Geometry> Renderable::GetGeometry() const=0;

GetMaterial() std::shared_ptr<Material> pure virtual

Returns the material used to draw this object.

cpp
virtual std::shared_ptr<Material> Renderable::GetMaterial() const=0;

GetNodeType() Node::Type virtual

Identifies this node as Node::Type::Renderable.

cpp
Type vglx::Renderable::GetNodeType() const override;

IsRenderable() bool virtual

Returns true, identifying this node as renderable.

cpp
bool Renderable::IsRenderable() const override;

Released under the MIT License.