Carna
Version 3.3.2
|
Produces stereoscopic renderings. More...
#include <ParallaxStage.h>
Public Member Functions | |
ParallaxStage (CompositionMode compositionMode) | |
Sets the eye distance to DEFAULT_EYE_DISTANCE. | |
ParallaxStage * | clone () const override |
Returns same RenderStage implementation with same configuration. More... | |
virtual | ~ParallaxStage () |
Deletes. | |
void | setEyeDistance (float) |
Sets the double of the distance that the camera is offset to left/right. | |
float | eyeDistance () const |
Tells the double of the distance that the camera is offset to left/right. | |
![]() | |
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. | |
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_EYE_DISTANCE |
Holds the default double distance that the camera is offset to left/right. | |
Protected Member Functions | |
virtual void | renderPass (const base::math::Matrix4f &viewTransform, base::RenderTask &rt, const base::Viewport &vp, bool isFirstInvocation, bool isFirstSource) override |
Renders one of the two renderings that are to be combined per invocation. More... | |
Additional Inherited Members | |
![]() | |
enum | CompositionMode { interleave, aside } |
Defines how two renderings are to be combined. More... | |
Produces stereoscopic renderings.
The instantiation of the ParallaxStage
takes a parameter that decides how the composition of the two images should be done:
We also enlarge the eye distance for demonstration purposes. For same reason, lets also add a few other rendering stages:
The concept of geometry types is explained here.
The last step is to setup the scene, e.g.:
The concept of materials, meshes and other geometry feature is explained here.
Definition at line 62 of file ParallaxStage.h.
|
overridevirtual |
Returns same RenderStage
implementation with same configuration.
The listeners and the rendering state are not copied.
Implements Carna::base::RenderStage.
|
overrideprotectedvirtual |
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.
Implements Carna::presets::CompositionStage.
Documentation generated by Doxygen