![]() |
LibCarna Version 3.4.0
|
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.hpp>
Public Member Functions | |
OccludedRenderingStage () | |
Sets translucency of occluding geometry to DEFAULT_OCCLUSION_TRANSLUCENCY. | |
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. | |
float | occlusionTranslucency () const |
Tells the translucency of the occluding geometry. | |
virtual void | reshape (base::FrameRenderer &fr, unsigned int width, unsigned int height) override |
Orders this stage to reshape its buffers according to the specified width and height. | |
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. | |
![]() | |
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. | |
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::FrameRenderer & | renderer () |
References the renderer this stage belongs to. | |
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 59 of file OccludedRenderingStage.hpp.
float LibCarna::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 before each frame.
Reimplemented from LibCarna::base::RenderStage.
|
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.
Implements LibCarna::base::RenderStage.
|
overridevirtual |
Orders this stage to reshape its buffers according to the specified width and height.
fr | references the frame renderer this stage belongs to. |
width | is the root viewport width. |
height | is the root viewport height. |
Reimplemented from LibCarna::base::RenderStage.
void LibCarna::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.
|
static |
Holds the default translucency of the occluding geometry.
Definition at line 73 of file OccludedRenderingStage.hpp.
Written by Leonid Kostrykin © 2021–2025. Based on Carna (© 2010-2016).
Documentation generated by Doxygen