Carna
Version 3.3.2
|
Renders geometry that is actually depth-occluded. The occluded geometry is rendered with reduced opacity on-top of the geometry that it is occluded by. More...
#include <OccludedRenderingStage.h>
Public Member Functions | |
OccludedRenderingStage () | |
Sets translucency of occluding geometry to DEFAULT_OCCLUSION_TRANSLUCENCY. | |
OccludedRenderingStage * | clone () const override |
Returns same RenderStage implementation with same configuration. More... | |
virtual | ~OccludedRenderingStage () |
Deletes. | |
void | disableAllStages () |
Disables all stages. | |
void | enableStage (const base::RenderStage &rs) |
Enables rs in \(\mathcal O\left(\log n\right)\). | |
void | disableStage (const base::RenderStage &rs) |
Disables rs in \(\mathcal O\left(\log n\right)\). | |
bool | isStageEnabled (const base::RenderStage &rs) const |
Tells whether rs is enabled in \(\mathcal O\left(\log n\right)\). | |
void | setOcclusionTranslucency (float translucency) |
Sets the translucency of the occluding geometry. More... | |
float | occlusionTranslucency () const |
Tells the translucency of the occluding geometry. 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 | prepareFrame (base::Node &root) override |
Called once before each frame. | |
virtual void | renderPass (const base::math::Matrix4f &viewTransform, base::RenderTask &rt, const base::Viewport &vp) override |
Called once per pass. More... | |
![]() | |
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 float | DEFAULT_OCCLUSION_TRANSLUCENCY |
Holds the default translucency of the occluding geometry. | |
Renders geometry that is actually depth-occluded. The occluded geometry is rendered with reduced opacity on-top of the geometry that it is occluded by.
Note that every geometry type that is to be rendered like described above when occluded must be enabled explicitly.
The following exemplary setup of the rendering process draws opaque meshes, that are occluded by cutting planes, on-top of them with reduced opacity:
Definition at line 56 of file OccludedRenderingStage.h.
|
overridevirtual |
Returns same RenderStage
implementation with same configuration.
The listeners and the rendering state are not copied.
Implements Carna::base::RenderStage.
float Carna::presets::OccludedRenderingStage::occlusionTranslucency | ( | ) | const |
Tells the translucency of the occluding geometry.
For translucency == 1
it looks as if the occluding geometry was completely translucent.
|
overridevirtual |
Called once per pass.
If this rendering stage maintains one or more Carna::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.
Implements Carna::base::RenderStage.
|
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.
void Carna::presets::OccludedRenderingStage::setOcclusionTranslucency | ( | float | translucency | ) |
Sets the translucency of the occluding geometry.
For translucency == 1
it looks as if the occluding geometry was completely translucent.
Documentation generated by Doxygen