RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
ramses::RenderPass Class Reference

The RenderPass is a container used to collect meshes which are supposed to be rendered together. More...

#include <RenderPass.h>

Inheritance diagram for ramses::RenderPass:
[legend]
Collaboration diagram for ramses::RenderPass:
[legend]

Public Member Functions

status_t setCamera (const Camera &camera)
 Set the camera to use for rendering the objects of this renderpass. More...
 
const CameragetCamera () const
 
CameragetCamera ()
 
status_t addRenderGroup (const RenderGroup &renderGroup, int32_t orderWithinPass=0)
 Add a RenderGroup to this RenderPass for rendering. More...
 
status_t removeRenderGroup (const RenderGroup &renderGroup)
 Remove a RenderGroup from this RenderPass. More...
 
bool containsRenderGroup (const RenderGroup &renderGroup) const
 Checks whether a RenderGroup is part of the RenderPass. More...
 
status_t getRenderGroupOrder (const RenderGroup &renderGroup, int32_t &orderWithinPass) const
 Gets a render order of given RenderGroup within this RenderPass. More...
 
status_t removeAllRenderGroups ()
 Will make the RenderPass empty. More...
 
status_t setRenderTarget (RenderTarget *renderTarget)
 Set the render target for the render pass to render into. More...
 
const RenderTargetgetRenderTarget () const
 Get the render target of this render pass. More...
 
status_t setRenderOrder (int32_t renderOrder)
 Set the render order for the render pass. More...
 
int32_t getRenderOrder () const
 Get the render order of this render pass. More...
 
status_t setClearColor (float r, float g, float b, float a)
 Set the clear color for the RenderPass (default: [0,0,0,0]) More...
 
void getClearColor (float &r, float &g, float &b, float &a) const
 Returns the clear color of the RenderPass. More...
 
status_t setClearFlags (uint32_t clearFlags)
 Set the clear flags which enable/disable the clearing of the render target assigned to this RenderPass(default: ramses::EClearFlags_All) More...
 
uint32_t getClearFlags () const
 Returns the clear flags of the RenderPass. More...
 
status_t setEnabled (bool enable)
 Enable/Disable render pass. More...
 
bool isEnabled () const
 Get the enable state of the render pass. More...
 
status_t setRenderOnce (bool enable)
 Set/unset render once flag - rendering of the render pass only once. More...
 
bool isRenderOnce () const
 Get the render once state of the render pass. More...
 
status_t retriggerRenderOnce ()
 Will re-render a render once pass. More...
 
- Public Member Functions inherited from ramses::SceneObject
sceneObjectId_t getSceneObjectId () const
 Returns scene object id which is automatically assigned at creation time of object and is unique within scope of one scene. More...
 
sceneId_t getSceneId () const
 Returns sceneid to which this object belongs to. More...
 
- Public Member Functions inherited from ramses::RamsesObject
const char * getName () const
 Returns the name of the object. More...
 
status_t setName (const char *name)
 Changes the name of the object. More...
 
ERamsesObjectType getType () const
 Gets type of the object. More...
 
bool isOfType (ERamsesObjectType type) const
 Checks if the object is of given type. More...
 
- Public Member Functions inherited from ramses::StatusObject
status_t validate () const
 Generates verbose validation of the object. More...
 
const char * getValidationReport (EValidationSeverity minSeverity=EValidationSeverity_Info) const
 Provides verbose report in human readable form generated by validate. More...
 
const char * getStatusMessage (status_t status) const
 Get the string description for a status provided by a RAMSES API function. More...
 
 StatusObject (const StatusObject &other)=delete
 Deleted copy constructor. More...
 
StatusObjectoperator= (const StatusObject &other)=delete
 Deleted copy assignment. More...
 

Public Attributes

class RenderPassImpl & impl
 
- Public Attributes inherited from ramses::SceneObject
class SceneObjectImpl & impl
 
- Public Attributes inherited from ramses::ClientObject
class ClientObjectImpl & impl
 
- Public Attributes inherited from ramses::RamsesObject
class RamsesObjectImpl & impl
 
- Public Attributes inherited from ramses::StatusObject
class StatusObjectImpl & impl
 

Protected Member Functions

 RenderPass (RenderPassImpl &pimpl)
 Constructor for RenderPass. More...
 
virtual ~RenderPass ()
 Destructor of the RenderPass. More...
 
- Protected Member Functions inherited from ramses::SceneObject
 SceneObject (SceneObjectImpl &pimpl)
 Constructor for SceneObject. More...
 
virtual ~SceneObject ()
 Destructor of the SceneObject. More...
 
- Protected Member Functions inherited from ramses::ClientObject
 ClientObject (ClientObjectImpl &pimpl)
 Constructor for ClientObject. More...
 
virtual ~ClientObject ()
 Destructor of the ClientObject. More...
 
- Protected Member Functions inherited from ramses::RamsesObject
 RamsesObject (RamsesObjectImpl &pimpl)
 Constructor for RamsesObject. More...
 
virtual ~RamsesObject ()
 Destructor of the RamsesObject. More...
 
- Protected Member Functions inherited from ramses::StatusObject
 StatusObject (StatusObjectImpl &pimpl)
 Constructor for StatusObject. More...
 
virtual ~StatusObject ()
 Destructor of the StatusObject. More...
 

Friends

class SceneImpl
 Scene is the factory for creating RenderPass instances. More...
 

Detailed Description

The RenderPass is a container used to collect meshes which are supposed to be rendered together.

A RenderPass has a Camera which is used for all MeshNodes rendered in the RenderPass. A MeshNode is rendered only if added to a RenderPass. The RenderPass can optionally have a RenderTarget used to redirect the output of the RenderPass. RenderPass objects are ordered together using a render order, which is also shared with BlitPass objects, i.e, RenderPass and BlitPass objects can all be ordered relative to each other.

Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, ramses-example-basic-blending/src/main.cpp, ramses-example-basic-compositing/src/main.cpp, ramses-example-basic-effect-from-glsl/src/main.cpp, ramses-example-basic-file-loading/src/main.cpp, ramses-example-basic-geometry/src/main.cpp, ramses-example-basic-rendergroups/src/main.cpp, ramses-example-basic-renderpasses/src/main.cpp, ramses-example-basic-rendertarget/src/main.cpp, ramses-example-basic-scenegraph/src/main.cpp, ramses-example-basic-texturing/src/main.cpp, ramses-example-data-buffers-texture/src/main.cpp, ramses-example-data-buffers-vertices/src/main.cpp, ramses-example-dcsm-provider/src/main.cpp, ramses-example-geometry-instancing/src/main.cpp, ramses-example-interleaved-vertex-buffers/src/main.cpp, ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-datalink/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-dma-offscreenbuffer/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, ramses-example-local-offscreenbuffer/src/main.cpp, ramses-example-local-pick-handling/src/main.cpp, ramses-example-local-scene-referencing/src/main.cpp, ramses-example-local-viewport-link/src/main.cpp, ramses-example-renderonce/src/main.cpp, ramses-example-text-basic/src/main.cpp, and ramses-example-text-languages/src/main.cpp.

Constructor & Destructor Documentation

◆ RenderPass()

ramses::RenderPass::RenderPass ( RenderPassImpl &  pimpl)
explicitprotected

Constructor for RenderPass.

Parameters
[in]pimplInternal data for implementation specifics of RenderPass (sink - instance becomes owner)

◆ ~RenderPass()

virtual ramses::RenderPass::~RenderPass ( )
protectedvirtual

Destructor of the RenderPass.

Member Function Documentation

◆ addRenderGroup()

status_t ramses::RenderPass::addRenderGroup ( const RenderGroup renderGroup,
int32_t  orderWithinPass = 0 
)

Add a RenderGroup to this RenderPass for rendering.

RenderGroup can be added to multiple RenderPass instances but cannot be added multiple times to the same instance.

Parameters
[in]renderGroupThe RenderGroup to be added.
[in]orderWithinPassOrder within the RenderPass that will be used for rendering. RenderGroup with lower number will be rendered before a RenderGroup with higher number.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, ramses-example-basic-blending/src/main.cpp, ramses-example-basic-compositing/src/main.cpp, ramses-example-basic-effect-from-glsl/src/main.cpp, ramses-example-basic-file-loading/src/main.cpp, ramses-example-basic-geometry/src/main.cpp, ramses-example-basic-rendergroups/src/main.cpp, ramses-example-basic-renderpasses/src/main.cpp, ramses-example-basic-rendertarget/src/main.cpp, ramses-example-basic-scenegraph/src/main.cpp, ramses-example-basic-texturing/src/main.cpp, ramses-example-data-buffers-texture/src/main.cpp, ramses-example-data-buffers-vertices/src/main.cpp, ramses-example-dcsm-provider/src/main.cpp, ramses-example-geometry-instancing/src/main.cpp, ramses-example-interleaved-vertex-buffers/src/main.cpp, ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-datalink/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-dma-offscreenbuffer/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, ramses-example-local-offscreenbuffer/src/main.cpp, ramses-example-local-pick-handling/src/main.cpp, ramses-example-local-scene-referencing/src/main.cpp, ramses-example-local-viewport-link/src/main.cpp, ramses-example-renderonce/src/main.cpp, ramses-example-text-basic/src/main.cpp, and ramses-example-text-languages/src/main.cpp.

◆ containsRenderGroup()

bool ramses::RenderPass::containsRenderGroup ( const RenderGroup renderGroup) const

Checks whether a RenderGroup is part of the RenderPass.

Parameters
[in]renderGroupThe RenderGroup to look for
Returns
true if the mesh is used in this RenderPass false otherwise

◆ getCamera() [1/2]

Camera* ramses::RenderPass::getCamera ( )

Get the camera of this RenderPass.

Returns
The camera or null if Camera has not been set.

◆ getCamera() [2/2]

const Camera* ramses::RenderPass::getCamera ( ) const

Get the camera of this RenderPass.

Returns
The camera or null if Camera has not been set.

◆ getClearColor()

void ramses::RenderPass::getClearColor ( float &  r,
float &  g,
float &  b,
float &  a 
) const

Returns the clear color of the RenderPass.

Parameters
[out]r,g,b,acolor channels of clear color

◆ getClearFlags()

uint32_t ramses::RenderPass::getClearFlags ( ) const

Returns the clear flags of the RenderPass.

Returns
clear flags, which is a bitmask of the ramses::EClearFlags enum

◆ getRenderGroupOrder()

status_t ramses::RenderPass::getRenderGroupOrder ( const RenderGroup renderGroup,
int32_t &  orderWithinPass 
) const

Gets a render order of given RenderGroup within this RenderPass.

Parameters
[in]renderGroupThe RenderGroup to query order for
[out]orderWithinPassOrder of the RenderGroup within this RenderPass
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ getRenderOrder()

int32_t ramses::RenderPass::getRenderOrder ( ) const

Get the render order of this render pass.

Returns
The render order of this render pass.

◆ getRenderTarget()

const RenderTarget* ramses::RenderPass::getRenderTarget ( ) const

Get the render target of this render pass.

Returns
The render target or null if render target has not been set.

◆ isEnabled()

bool ramses::RenderPass::isEnabled ( ) const

Get the enable state of the render pass.

Returns
Indicates if the render pass is enabled

◆ isRenderOnce()

bool ramses::RenderPass::isRenderOnce ( ) const

Get the render once state of the render pass.

Returns
Indicates if the render pass is to be rendered only once

◆ removeAllRenderGroups()

status_t ramses::RenderPass::removeAllRenderGroups ( )

Will make the RenderPass empty.

Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ removeRenderGroup()

status_t ramses::RenderPass::removeRenderGroup ( const RenderGroup renderGroup)

Remove a RenderGroup from this RenderPass.

Parameters
[in]renderGroupThe RenderGroup to be removed.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ retriggerRenderOnce()

status_t ramses::RenderPass::retriggerRenderOnce ( )

Will re-render a render once pass.

If content of the render once pass changes and needs to be rendered once more this method will guarantee the render pass to be rendered once more with the state of the scene flushed together with this command.

Note that Ramses does not track changes of render pass content and will not automatically re-render a render once pass if its content changed.

Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-renderonce/src/main.cpp.

◆ setCamera()

status_t ramses::RenderPass::setCamera ( const Camera camera)

Set the camera to use for rendering the objects of this renderpass.

Parameters
cameraThe camera to use.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, ramses-example-basic-blending/src/main.cpp, ramses-example-basic-compositing/src/main.cpp, ramses-example-basic-effect-from-glsl/src/main.cpp, ramses-example-basic-file-loading/src/main.cpp, ramses-example-basic-geometry/src/main.cpp, ramses-example-basic-rendergroups/src/main.cpp, ramses-example-basic-renderpasses/src/main.cpp, ramses-example-basic-rendertarget/src/main.cpp, ramses-example-basic-scenegraph/src/main.cpp, ramses-example-basic-texturing/src/main.cpp, ramses-example-data-buffers-texture/src/main.cpp, ramses-example-data-buffers-vertices/src/main.cpp, ramses-example-dcsm-provider/src/main.cpp, ramses-example-geometry-instancing/src/main.cpp, ramses-example-interleaved-vertex-buffers/src/main.cpp, ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-datalink/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-dma-offscreenbuffer/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, ramses-example-local-offscreenbuffer/src/main.cpp, ramses-example-local-pick-handling/src/main.cpp, ramses-example-local-scene-referencing/src/main.cpp, ramses-example-local-viewport-link/src/main.cpp, ramses-example-renderonce/src/main.cpp, ramses-example-text-basic/src/main.cpp, and ramses-example-text-languages/src/main.cpp.

◆ setClearColor()

status_t ramses::RenderPass::setClearColor ( float  r,
float  g,
float  b,
float  a 
)

Set the clear color for the RenderPass (default: [0,0,0,0])

The clear color will be used to clear a render target assigned to this RenderPass if clear flag is enabled, see setClearFlag.

Parameters
r,g,b,acolor channels of clear color
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-rendertarget/src/main.cpp, ramses-example-dcsm-provider/src/main.cpp, ramses-example-local-offscreenbuffer/src/main.cpp, and ramses-example-renderonce/src/main.cpp.

◆ setClearFlags()

status_t ramses::RenderPass::setClearFlags ( uint32_t  clearFlags)

Set the clear flags which enable/disable the clearing of the render target assigned to this RenderPass(default: ramses::EClearFlags_All)

The clear flags have no effect on render passes with no render target assigned, i.e. it is not allowed to control clearing of display buffer (whether it is framebuffer or offscreen buffer) on renderer side from within scene's render pass.

Parameters
clearFlagsclear flags, which is a bitmask of the ramses::EClearFlags enum
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, ramses-example-basic-blending/src/main.cpp, ramses-example-basic-compositing/src/main.cpp, ramses-example-basic-effect-from-glsl/src/main.cpp, ramses-example-basic-file-loading/src/main.cpp, ramses-example-basic-geometry/src/main.cpp, ramses-example-basic-rendergroups/src/main.cpp, ramses-example-basic-renderpasses/src/main.cpp, ramses-example-basic-rendertarget/src/main.cpp, ramses-example-basic-scenegraph/src/main.cpp, ramses-example-basic-texturing/src/main.cpp, ramses-example-data-buffers-texture/src/main.cpp, ramses-example-data-buffers-vertices/src/main.cpp, ramses-example-dcsm-provider/src/main.cpp, ramses-example-geometry-instancing/src/main.cpp, ramses-example-interleaved-vertex-buffers/src/main.cpp, ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-datalink/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, ramses-example-local-offscreenbuffer/src/main.cpp, ramses-example-local-pick-handling/src/main.cpp, ramses-example-local-scene-referencing/src/main.cpp, ramses-example-local-viewport-link/src/main.cpp, ramses-example-renderonce/src/main.cpp, ramses-example-text-basic/src/main.cpp, and ramses-example-text-languages/src/main.cpp.

◆ setEnabled()

status_t ramses::RenderPass::setEnabled ( bool  enable)

Enable/Disable render pass.

Parameters
enableThe enable flag which indicates if the render pass is rendered (Default:true)
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ setRenderOnce()

status_t ramses::RenderPass::setRenderOnce ( bool  enable)

Set/unset render once flag - rendering of the render pass only once.

By default render pass is rendered every frame, the render once flag can be used to tell the renderer to render the render pass just once. This can be useful for pre-rendering of heavy content into render targets, etc.

This flag is orthogonal to all the other states of render pass, e.g. render pass is not rendered at all if it is disabled (see setEnabled) regardless of render once flag set or unset.

When render pass is enabled and render once set it is guaranteed to be rendered at least once (can be more if scene is unmapped/mapped on renderer side).

Parameters
enableThe flag which indicates if the render pass is to be rendered only once (Default:false)
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-renderonce/src/main.cpp.

◆ setRenderOrder()

status_t ramses::RenderPass::setRenderOrder ( int32_t  renderOrder)

Set the render order for the render pass.

This order defines the order in which the render pass is executed relative to other render and blit passes. Render and blit passes with lower render order are executed first. Render and blit passes with same render order might be executed by the renderer in any order.

The default render order is Zero.

Parameters
renderOrderRender order used for ordering the render pass
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-local-offscreenbuffer/src/main.cpp.

◆ setRenderTarget()

status_t ramses::RenderPass::setRenderTarget ( RenderTarget renderTarget)

Set the render target for the render pass to render into.

Parameters
renderTargetThe render target to render into, set to null for direct framebuffer rendering
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-basic-rendertarget/src/main.cpp, ramses-example-local-offscreenbuffer/src/main.cpp, and ramses-example-renderonce/src/main.cpp.

Friends And Related Function Documentation

◆ SceneImpl

friend class SceneImpl
friend

Scene is the factory for creating RenderPass instances.

Member Data Documentation

◆ impl

class RenderPassImpl& ramses::RenderPass::impl

Stores internal data for implementation specifics of RenderPass.


The documentation for this class was generated from the following file: