LibCarna Version 3.4.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
LibCarna::base::MeshRenderingStage< RenderableCompare > Class Template Reference

Implements a geometry rendering stage that renders meshes. More...

#include <MeshRenderingStage.hpp>

+ Inheritance diagram for LibCarna::base::MeshRenderingStage< RenderableCompare >:
+ Collaboration diagram for LibCarna::base::MeshRenderingStage< RenderableCompare >:

Public Member Functions

 MeshRenderingStage (unsigned int geometryType)
 Instantiates.
 
virtual void renderPass (const math::Matrix4f &viewTransform, RenderTask &rt, const Viewport &vp) override
 Called once per pass.
 
- Public Member Functions inherited from LibCarna::base::GeometryStage< RenderableCompare >
 GeometryStage (unsigned int geometryType, unsigned int geometryTypeMask=RenderQueue< RenderableCompare >::EXACT_MATCH_GEOMETRY_TYPE_MASK)
 Instantiates s.t. the predefined rendering queue enqueues such LibCarna::base::Geometry scene graph nodes, whose geometry type AND-linked with geometryTypeMask equals the geometryType specified here.
 
virtual ~GeometryStage ()
 Releases acquired video resources.
 
virtual void prepareFrame (Node &root) override
 Called once before each frame.
 
std::size_t renderedPassesCount () const
 Tells the number of passes rendered so far since the beginning of the current frame.
 
template<typename GeometryFeatureType >
GeometryFeatureType::ManagedInterface & videoResource (GeometryFeatureType &geometryFeature) const
 Interfaces the geometryFeature video resources that were acquired by this rendering stage.
 
template<typename GeometryFeatureType >
const GeometryFeatureType::ManagedInterface & videoResource (const GeometryFeatureType &geometryFeature) const
 
- Public Member Functions inherited from LibCarna::base::RenderStage
 RenderStage ()
 Instantiates in enabled-state.
 
virtual ~RenderStage ()
 Deletes.
 
void setViewTransformFixed (bool viewTransformFixed)
 Sets whether the view transform is pass-invariant for the duration of a single frame.
 
bool isViewTransformFixed () const
 Tells whether the view transform is pass-invariant for the duration of a single frame.
 
virtual void reshape (FrameRenderer &fr, unsigned int width, unsigned int height)
 Orders this stage to reshape its buffers according to the specified width and height.
 
bool isInitialized () const
 Tells whether this stage is ready for rendering.
 
bool isEnabled () const
 Tells whether this stage is enabled. Disabled stages are not rendered by render tasks.
 
void setEnabled (bool)
 Sets whether this stage is enabled. Disabled stages are not rendered by render tasks.
 
base::FrameRendererrenderer ()
 References the renderer this stage belongs to.
 
const base::FrameRendererrenderer () const
 
void addRenderStageListener (RenderStageListener &listener)
 Adds listener to the set of listeners this instance notifies in \(\mathcal O\left(\log n\right)\).
 
void removeRenderStageListener (RenderStageListener &listener)
 Removes listener from the set of listeners this instance notifies in \(\mathcal O\left(\log n\right)\).
 
- Public Member Functions inherited from LibCarna::base::MeshRenderingMixin
 MeshRenderingMixin (unsigned int geometryType)
 Instantiates.
 
virtual ~MeshRenderingMixin ()
 Does nothing.
 

Protected Member Functions

virtual void render (const Renderable &renderable) override
 Renders the renderable.
 
- Protected Member Functions inherited from LibCarna::base::GeometryStage< RenderableCompare >
void activateGLContext () const
 Ensures that the OpenGL context of the hosting LibCarna::base::FrameRenderer is the current one.
 
virtual void buildRenderQueues (Node &root, const math::Matrix4f &viewTransform)
 Builds the rendering queues of this stage.
 
virtual void rewindRenderQueues ()
 Rewinds the rendering queues of this stage.
 
virtual void updateRenderQueues (const math::Matrix4f &viewTransform)
 Recomputes the model-view transforms of the renderables enqueued by this stage.
 

Additional Inherited Members

- Public Attributes inherited from LibCarna::base::GeometryStage< RenderableCompare >
const unsigned int geometryType
 Renders such geometries whose type AND-linked with geometryTypeMask equals this.
 
const unsigned int geometryTypeMask
 Renders such geometries whose type AND-linked with this equals geometryType.
 
- Public Attributes inherited from LibCarna::base::MeshRenderingMixin
const unsigned int geometryType
 Holds the geometry type rendered by this MeshRenderingStage.
 
- Static Public Attributes inherited from LibCarna::base::MeshRenderingMixin
static const unsigned int DEFAULT_ROLE_MESH = 0
 Identifies the Mesh object that MeshRenderingStage uses for rendering.
 
static const unsigned int DEFAULT_ROLE_MATERIAL = 1
 Identifies the Material object that MeshRenderingStage uses for rendering.
 
- Protected Attributes inherited from LibCarna::base::GeometryStage< RenderableCompare >
RenderQueue< RenderableComparerq
 Holds the predefined rendering queue of this rendering stage.
 

Detailed Description

template<typename RenderableCompare>
class LibCarna::base::MeshRenderingStage< RenderableCompare >

Implements a geometry rendering stage that renders meshes.

See also
Refer to the documentation of the rendering process for further notes on how rendering stages operate.

An instance of this rendering stage expects two features from the Geometry objects it processes:

Author
Leonid Kostrykin

Definition at line 110 of file MeshRenderingStage.hpp.

Constructor & Destructor Documentation

◆ MeshRenderingStage()

LibCarna::base::MeshRenderingStage< RenderableCompare >::MeshRenderingStage ( unsigned int  geometryType)

Instantiates.

Parameters
geometryTypeis the geometry type rendered by this stage.

Definition at line 137 of file MeshRenderingStage.hpp.

Member Function Documentation

◆ render()

void LibCarna::base::MeshRenderingStage< RenderableCompare >::render ( const Renderable renderable)
overrideprotectedvirtual

Renders the renderable.

Implements LibCarna::base::GeometryStage< RenderableCompare >.

Definition at line 154 of file MeshRenderingStage.hpp.

◆ renderPass()

void LibCarna::base::MeshRenderingStage< RenderableCompare >::renderPass ( const math::Matrix4f viewTransform,
RenderTask rt,
const Viewport vp 
)
overridevirtual

Called once per pass.

If this rendering stage maintains one or more LibCarna::base::RenderQueue objects, than this is the right place to build them. Note that the queues need to be rebuilt only once per frame and not per pass, unless isViewTransformFixed is false. If it is true and this is not the first invocation of this method since the last time prepareFrame was called, rewinding the queue will be sufficient.

Reimplemented from LibCarna::base::GeometryStage< RenderableCompare >.

Reimplemented in LibCarna::presets::TransparentRenderingStage.

Definition at line 145 of file MeshRenderingStage.hpp.


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