Carna
Version 3.3.2
|
Renders maximum intensity projections of volume geometries in the scene. More...
#include <MIPStage.h>
Public Member Functions | |
MIPStage (unsigned int geometryType) | |
Instantiates. | |
virtual | ~MIPStage () |
Deletes. | |
MIPStage * | clone () const override |
Returns same RenderStage implementation with same configuration. More... | |
virtual void | reshape (base::FrameRenderer &fr, unsigned int width, unsigned int height) override |
Orders this stage to reshape its buffers according to the specified dimensions. More... | |
virtual void | renderPass (const base::math::Matrix4f &viewTransform, base::RenderTask &rt, const base::Viewport &vp) override |
Triggers the volume rendering. | |
void | ascendLayer (const MIPLayer &layer) |
Swaps positions of layer with it's successor in the layers list. | |
void | appendLayer (MIPLayer *layer) |
Appends layer to the layers list and takes it's ownership. | |
MIPLayer * | removeLayer (const MIPLayer &layer) |
Removes layer from the layers list. The ownership is transferred to the caller. | |
std::size_t | layersCount () const |
Tells number of layers. | |
MIPLayer & | layer (std::size_t layerIndex) |
References the layer with layerIndex. | |
const MIPLayer & | layer (std::size_t layerIndex) const |
void | clearLayers () |
Clears the layers list. | |
![]() | |
VolumeRenderingStage (unsigned int geometryType) | |
Instantiates. The created stage will render such base::Geometry scene graph nodes, whose geometry types equal geometryType. | |
virtual | ~VolumeRenderingStage () |
Deletes. | |
void | setSampleRate (unsigned int sampleRate) |
Sets number of slices to be rendered per segment. More... | |
unsigned int | sampleRate () const |
Tells number of slices to be rendered per segment. More... | |
![]() | |
GeometryStage (unsigned int geometryType, unsigned int geometryTypeMask=RenderQueue< base::Renderable::BackToFront >::EXACT_MATCH_GEOMETRY_TYPE_MASK) | |
Instantiates s.t. the predefined rendering queue enqueues such Carna::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. More... | |
std::size_t | renderedPassesCount () const |
Tells the number of passes rendered so far since the beginning of the current frame. | |
GeometryFeatureType::ManagedInterface & | videoResource (GeometryFeatureType &geometryFeature) const |
Interfaces the geometryFeature video resources that were acquired by this rendering stage. | |
const GeometryFeatureType::ManagedInterface & | videoResource (const GeometryFeatureType &geometryFeature) const |
![]() | |
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. More... | |
bool | isViewTransformFixed () const |
Tells whether the view transform is pass-invariant for the duration of a single frame. | |
bool | isInitialized () const |
Tells whether this stage is ready for rendering. More... | |
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::FrameRenderer & | renderer () |
References the renderer this stage belongs to. More... | |
const base::FrameRenderer & | renderer () 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)\). | |
Static Public Attributes | |
static const unsigned int | ROLE_INTENSITIES = 0 |
Holds the role that intensity volume data is expected to take when attached to base::Geometry nodes. | |
![]() | |
static const unsigned int | DEFAULT_SAMPLE_RATE = 200 |
Holds the default number of slices rendered per segment. | |
Protected Member Functions | |
virtual void | createVolumeSamplers (const std::function< void(unsigned int, base::Sampler *) > ®isterSampler) override |
Creates texture samplers for volume textures and uses registerSampler to assign them to the roles that they should be used with. | |
virtual const base::ShaderProgram & | acquireShader () override |
Acquires the shader from the base::ShaderManager, that is to be used for rendering the slices. | |
virtual const std::string & | uniformName (unsigned int role) const override |
Tells the name of the uniform variable, that the role texture is to be bound to. Use configureShader for custom shader configuration that goes beyond that. | |
virtual void | configureShader () override |
Performs custom shader configuration on a per-pass level. | |
virtual void | configureShader (const base::Renderable &) override |
Does nothing. | |
![]() | |
virtual unsigned int | loadVideoResources () |
Loads video resources when rendering is triggered for the first time. Override this method if you need any additional resources to be loaded, but always call the base implementation. More... | |
virtual void | render (const base::Renderable &) override |
Renders the renderable. | |
![]() | |
void | activateGLContext () const |
Ensures that the OpenGL context of the hosting Carna::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 | |
![]() | |
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. | |
![]() | |
RenderQueue< base::Renderable::BackToFront > | rq |
Holds the predefined rendering queue of this rendering stage. | |
Renders maximum intensity projections of volume geometries in the scene.
The MIPStage
constructor takes a geometry type parameter:
The concept of geometry types is explained here.
The next code snippet turns the second layer to additive-mode:
Definition at line 64 of file MIPStage.h.
|
overridevirtual |
Returns same RenderStage
implementation with same configuration.
The listeners and the rendering state are not copied.
Implements Carna::base::RenderStage.
const MIPLayer& Carna::presets::MIPStage::layer | ( | std::size_t | layerIndex | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
overridevirtual |
Orders this stage to reshape its buffers according to the specified dimensions.
fr | references the frame renderer this stage belongs to. |
width | is the root viewport width. |
height | is the root viewport height. |
Reimplemented from Carna::base::RenderStage.
Documentation generated by Doxygen