Carna
Version 3.0.1
|
Defines rendering stage that combines two other renderings either by putting them next to each other or through row-wise interleaving. More...
#include <CompositionStage.h>
Public Types | |
enum | CompositionMode { interleave, aside } |
Defines how two renderings are to be combined. More... | |
Public Member Functions | |
CompositionStage (CompositionMode compositionMode) | |
Instantiates. | |
virtual | ~CompositionStage () |
Deletes. | |
void | setCompositionMode (CompositionMode compositionMode) |
Sets how the two renderings obtained through renderPass(const base::math::Matrix4f&,base::RenderTask&,const base::Viewport&,bool,bool) shall be combined. | |
CompositionMode | compositionMode () const |
Tells how the two renderings obtained through renderPass(const base::math::Matrix4f&,base::RenderTask&,const base::Viewport&,bool,bool) are combined. | |
void | setCompositionSwap (bool) |
Swaps the two renderings obtained through renderPass(const base::math::Matrix4f&,base::RenderTask&,const base::Viewport&,bool,bool) when combining. | |
bool | isCompositionSwapped () const |
Tells whether the two renderings obtained through renderPass(const base::math::Matrix4f&,base::RenderTask&,const base::Viewport&,bool,bool) are swapped when combined. | |
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 |
Invokes renderPass(const base::math::Matrix4f&,base::RenderTask&,const base::Viewport&,bool,bool) twice and combines the results like specified. | |
![]() | |
RenderStage () | |
Instantiates in enabled-state. | |
virtual | ~RenderStage () |
Deletes. | |
virtual RenderStage * | clone () const =0 |
Returns same RenderStage implementation with same configuration. More... | |
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)\). | |
Protected Member Functions | |
virtual void | renderPass (const base::math::Matrix4f &viewTransform, base::RenderTask &rt, const base::Viewport &vp, bool isFirstInvocation, bool isFirstSource)=0 |
Renders one of the two renderings that are to be combined per invocation. More... | |
Defines rendering stage that combines two other renderings either by putting them next to each other or through row-wise interleaving.
Definition at line 41 of file CompositionStage.h.
Defines how two renderings are to be combined.
Enumerator | |
---|---|
interleave |
Combines renderings through row-wise interleaving. ![]() |
aside |
Combines renderings by putting them next to each other. ![]() |
Definition at line 52 of file CompositionStage.h.
|
protectedpure virtual |
Renders one of the two renderings that are to be combined per invocation.
viewTransform | transforms world space to view space. |
rt | references the rendering task. |
vp | references the viewport. |
isFirstInvocation | indicates whether this is the first rendering invocation of the current rendering pass. |
isFirstSource | indicates whether this rendering should be done using the "first" method/source/algorithm. |
Note that isFirstInvocation == isFirstSource
is true when swapping was disabled and isFirstInvocation != isFirstSource
is true if it was enabled.
Implemented in Carna::presets::ParallaxStage.
|
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