Gazebo Rendering

API Reference

6.6.3

Ogre2.x implementation of the render target class. More...

#include <Ogre2RenderTarget.hh>

Public Member Functions

virtual ~Ogre2RenderTarget ()
 Destructor. More...
 
virtual unsigned int AntiAliasing () const
 Get the anti-aliasing level. More...
 
virtual math::Color BackgroundColor () const override
 Get the background color of the render target. This should be the same as the scene background color. More...
 
virtual MaterialPtr BackgroundMaterial () const
 Get the background material of this camera. More...
 
virtual Ogre::Camera * Camera () const
 Get a pointer to the internal ogre camera. More...
 
virtual void Copy (Image &_image) const override
 Copy the render target buffer data to an image. More...
 
virtual void Destroy () override=0
 Destroy the render target. More...
 
unsigned int GLIdImpl () const
 
virtual bool IsRenderWindow () const
 Returns true if this is a render window. More...
 
virtual void PostRender () override
 Post process this object and any of its children after rendering. More...
 
virtual void PreRender () override
 Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender. More...
 
virtual void Render ()
 Main render call. More...
 
virtual Ogre::TextureGpu * RenderTarget () const =0
 Get a pointer to the ogre render target containing the results of the render. More...
 
virtual void SetAntiAliasing (unsigned int _aa)
 set the anti-aliasing level More...
 
virtual void SetBackgroundColor (math::Color _color)
 Set the background color of the render target. More...
 
virtual void SetBackgroundMaterial (MaterialPtr _material)
 Set the background material of this camera. More...
 
virtual void SetCamera (Ogre::Camera *_camera)
 Set the ogre camera to use for this render target. More...
 
void SetMaterial (MaterialPtr _material)
 Set a material to render on every object. This method is used for special cases like the render target of a depth camera. More...
 
void SetShadowsNodeDefDirty ()
 
virtual void SetVisibilityMask (uint32_t _mask)
 Set visibility mask for the viewport associated with this render target. More...
 
virtual uint32_t VisibilityMask () const
 Get visibility mask for the viewport associated with this render target. More...
 
- Public Member Functions inherited from BaseRenderTarget< Ogre2Object >
 BaseRenderTarget ()
 
virtual ~BaseRenderTarget ()
 
virtual void AddRenderPass (const RenderPassPtr &_pass) override
 Add a render pass to the render target. More...
 
virtual math::Color BackgroundColor () const override
 Get the background color of the render target. This should be the same as the scene background color. More...
 
virtual PixelFormat Format () const override
 Set the render target image format. More...
 
virtual unsigned int Height () const override
 Get render target height in pixels. More...
 
virtual void RemoveRenderPass (const RenderPassPtr &_pass) override
 Remove a render pass from the render target. More...
 
virtual RenderPassPtr RenderPassByIndex (unsigned int _index) const override
 Get a render pass by index. More...
 
virtual unsigned int RenderPassCount () const override
 Get the number of render passes applied to the render target. More...
 
virtual void SetFormat (PixelFormat _format) override
 Set the render target image format. More...
 
virtual void SetHeight (const unsigned int _height) override
 Set the render target height in pixels. More...
 
virtual void SetWidth (const unsigned int _width) override
 Set the render target width in pixels. More...
 
virtual unsigned int Width () const override
 Get render target width in pixels. More...
 
- Public Member Functions inherited from RenderTarget
virtual ~RenderTarget ()
 Destructor. More...
 
virtual PixelFormat Format () const =0
 Set the render target image format. More...
 
virtual unsigned int Height () const =0
 Get render target height in pixels. More...
 
virtual unsigned int RenderPassCount () const =0
 Get the number of render passes applied to the render target. More...
 
virtual unsigned int Width () const =0
 Get render target width in pixels. More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 Destructor. More...
 
virtual unsigned int Id () const =0
 Get the object ID. This ID will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual std::string Name () const =0
 Get the object name. This name will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual ScenePtr Scene () const =0
 Get the Scene that created this object. More...
 
- Public Member Functions inherited from Ogre2Object
virtual ~Ogre2Object ()
 Destructor. More...
 
virtual ScenePtr Scene () const override
 
- Public Member Functions inherited from BaseObject
virtual ~BaseObject ()
 
virtual unsigned int Id () const override
 
virtual std::string Name () const override
 

Static Public Member Functions

static void UpdateRenderPassChain (Ogre::CompositorWorkspace *_workspace, const std::string &_workspaceDefName, const std::string &_baseNode, const std::string &_finalNode, const std::vector< RenderPassPtr > &_renderPasses, bool _recreateNodes, Ogre::TextureGpu *(*_ogreTextures)[2], bool _isRenderWindow)
 Update the render pass chain. More...
 

Protected Member Functions

 Ogre2RenderTarget ()
 Constructor. More...
 
virtual void BuildCompositor ()
 Build the compositor. More...
 
void BuildTargetImpl ()
 Build the render texture. More...
 
virtual void DestroyCompositor ()
 Destroy the compositor. More...
 
void DestroyTargetImpl ()
 Destroy the render texture. More...
 
virtual void RebuildCompositor ()
 Rebuild the compositor. More...
 
virtual void RebuildImpl () override
 Implementation of the Rebuild function. More...
 
void RebuildMaterial ()
 Re-initializes render target material to apply a material to everything in the scene. Does nothing if no material has been set. More...
 
virtual void RebuildTarget ()=0
 Rebuild the render target. More...
 
Ogre::TextureGpu * RenderTargetImpl () const
 Get a pointer to the ogre render target containing the results of the render (implemented separately to avoid breaking ABI of the pure virtual function) More...
 
uint8_t TargetFSAA () const
 Returns the FSAA to use based on supported specs by HW and value specified in Ogre2RenderTarget::AntiAliasing. More...
 
virtual void UpdateBackgroundColor ()
 Update the background color. More...
 
virtual void UpdateBackgroundMaterial ()
 Update the background material. More...
 
virtual void UpdateRenderPassChain ()
 Update the render pass chain. More...
 
- Protected Member Functions inherited from BaseRenderTarget< Ogre2Object >
virtual void Rebuild ()
 
- Protected Member Functions inherited from Ogre2Object
 Ogre2Object ()
 Constructor. More...
 
- Protected Member Functions inherited from BaseObject
 BaseObject ()
 
virtual void Init ()
 
virtual void Load ()
 

Protected Attributes

unsigned int antiAliasing = 4
 Anti-aliasing level. More...
 
MaterialPtr backgroundMaterial
 Background material of the render target. More...
 
bool backgroundMaterialDirty = false
 Flag to indicate if the render target background material has changed. More...
 
bool colorDirty = true
 Flag to indicate if the render target color has changed. More...
 
MaterialPtr material
 a material used by for the render target More...
 
Ogre2RenderTargetMaterialPtr materialApplicator
 Helper class that applies the material to the render target. More...
 
Ogre::ColourValue ogreBackgroundColor
 Stores the background color of the render target. More...
 
Ogre::Camera * ogreCamera = nullptr
 Pointer to the internal ogre camera. More...
 
Ogre::CompositorWorkspace * ogreCompositorWorkspace = nullptr
 Ogre's compositor workspace - the main interface to render into a render target or render texture. More...
 
std::string ogreCompositorWorkspaceDefName
 Ogre's compositor workspace definition name. More...
 
uint32_t visibilityMask = IGN_VISIBILITY_ALL
 visibility mask associated with this render target More...
 
- Protected Attributes inherited from BaseRenderTarget< Ogre2Object >
PixelFormat format
 
unsigned int height
 
bool renderPassDirty
 Flag to indicate if render pass need to be rebuilt. More...
 
std::vector< RenderPassPtrrenderPasses
 A chain of render passes applied to the render target. More...
 
bool targetDirty
 
unsigned int width
 
- Protected Attributes inherited from Ogre2Object
Ogre2ScenePtr scene
 Pointer to the ogre scene. More...
 
- Protected Attributes inherited from BaseObject
unsigned int id
 
std::string name
 

Detailed Description

Ogre2.x implementation of the render target class.

Constructor & Destructor Documentation

◆ Ogre2RenderTarget()

Ogre2RenderTarget ( )
protected

Constructor.

◆ ~Ogre2RenderTarget()

virtual ~Ogre2RenderTarget ( )
virtual

Destructor.

Member Function Documentation

◆ AntiAliasing()

virtual unsigned int AntiAliasing ( ) const
virtual

Get the anti-aliasing level.

◆ BackgroundColor()

virtual math::Color BackgroundColor ( ) const
overridevirtual

Get the background color of the render target. This should be the same as the scene background color.

Returns
Render target background color.

Implements RenderTarget.

◆ BackgroundMaterial()

virtual MaterialPtr BackgroundMaterial ( ) const
virtual

Get the background material of this camera.

Returns
background material

◆ BuildCompositor()

virtual void BuildCompositor ( )
protectedvirtual

Build the compositor.

◆ BuildTargetImpl()

void BuildTargetImpl ( )
protected

Build the render texture.

◆ Camera()

virtual Ogre::Camera* Camera ( ) const
virtual

Get a pointer to the internal ogre camera.

Returns
Pointer to ogre camera

◆ Copy()

virtual void Copy ( Image _image) const
overridevirtual

Copy the render target buffer data to an image.

Parameters
[in]_imageImage to copy the data to

Implements RenderTarget.

◆ Destroy()

virtual void Destroy ( )
overridepure virtual

Destroy the render target.

Reimplemented from BaseObject.

Implemented in Ogre2RenderWindow, and Ogre2RenderTexture.

◆ DestroyCompositor()

virtual void DestroyCompositor ( )
protectedvirtual

Destroy the compositor.

◆ DestroyTargetImpl()

void DestroyTargetImpl ( )
protected

Destroy the render texture.

◆ GLIdImpl()

unsigned int GLIdImpl ( ) const

◆ IsRenderWindow()

virtual bool IsRenderWindow ( ) const
virtual

Returns true if this is a render window.

Returns
True if this render target is a render window

Reimplemented in Ogre2RenderWindow.

◆ PostRender()

virtual void PostRender ( )
overridevirtual

Post process this object and any of its children after rendering.

Reimplemented from BaseRenderTarget< Ogre2Object >.

Reimplemented in Ogre2RenderTexture.

◆ PreRender()

virtual void PreRender ( )
overridevirtual

Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender.

Reimplemented from BaseRenderTarget< Ogre2Object >.

Reimplemented in Ogre2RenderTexture.

◆ RebuildCompositor()

virtual void RebuildCompositor ( )
protectedvirtual

Rebuild the compositor.

◆ RebuildImpl()

virtual void RebuildImpl ( )
overrideprotectedvirtual

Implementation of the Rebuild function.

Implements BaseRenderTarget< Ogre2Object >.

◆ RebuildMaterial()

void RebuildMaterial ( )
protected

Re-initializes render target material to apply a material to everything in the scene. Does nothing if no material has been set.

See also
Ogre2RenderTarget::RebuildImpl()
BaseRenderTarget::Rebuild()

◆ RebuildTarget()

virtual void RebuildTarget ( )
protectedpure virtual

Rebuild the render target.

Implemented in Ogre2RenderWindow, and Ogre2RenderTexture.

◆ Render()

virtual void Render ( )
virtual

Main render call.

◆ RenderTarget()

virtual Ogre::TextureGpu* RenderTarget ( ) const
pure virtual

Get a pointer to the ogre render target containing the results of the render.

Implemented in Ogre2RenderWindow, and Ogre2RenderTexture.

◆ RenderTargetImpl()

Ogre::TextureGpu* RenderTargetImpl ( ) const
protected

Get a pointer to the ogre render target containing the results of the render (implemented separately to avoid breaking ABI of the pure virtual function)

◆ SetAntiAliasing()

virtual void SetAntiAliasing ( unsigned int  _aa)
virtual

set the anti-aliasing level

Parameters
[in]_aaAnti-aliasing level

◆ SetBackgroundColor()

virtual void SetBackgroundColor ( math::Color  _color)
virtual

Set the background color of the render target.

Parameters
[in]_colorColor to set the background to

◆ SetBackgroundMaterial()

virtual void SetBackgroundMaterial ( MaterialPtr  _material)
virtual

Set the background material of this camera.

Parameters
[in]_materialMaterial to set the background to

◆ SetCamera()

virtual void SetCamera ( Ogre::Camera *  _camera)
virtual

Set the ogre camera to use for this render target.

Parameters
[in]_cameraPointer to ogre camera

◆ SetMaterial()

void SetMaterial ( MaterialPtr  _material)

Set a material to render on every object. This method is used for special cases like the render target of a depth camera.

Parameters
[in]_materialThe material to render

◆ SetShadowsNodeDefDirty()

void SetShadowsNodeDefDirty ( )
See also
Camera::SetShadowsNodeDefDirty

◆ SetVisibilityMask()

virtual void SetVisibilityMask ( uint32_t  _mask)
virtual

Set visibility mask for the viewport associated with this render target.

Parameters
[in]_maskVisibility mask

◆ TargetFSAA()

uint8_t TargetFSAA ( ) const
protected

Returns the FSAA to use based on supported specs by HW and value specified in Ogre2RenderTarget::AntiAliasing.

Returns
Value in range [1; 256). 1 means no antialiasing.

◆ UpdateBackgroundColor()

virtual void UpdateBackgroundColor ( )
protectedvirtual

Update the background color.

◆ UpdateBackgroundMaterial()

virtual void UpdateBackgroundMaterial ( )
protectedvirtual

Update the background material.

◆ UpdateRenderPassChain() [1/2]

virtual void UpdateRenderPassChain ( )
protectedvirtual

Update the render pass chain.

◆ UpdateRenderPassChain() [2/2]

static void UpdateRenderPassChain ( Ogre::CompositorWorkspace *  _workspace,
const std::string _workspaceDefName,
const std::string _baseNode,
const std::string _finalNode,
const std::vector< RenderPassPtr > &  _renderPasses,
bool  _recreateNodes,
Ogre::TextureGpu *(*)  _ogreTextures[2],
bool  _isRenderWindow 
)
static

Update the render pass chain.

◆ VisibilityMask()

virtual uint32_t VisibilityMask ( ) const
virtual

Get visibility mask for the viewport associated with this render target.

Returns
Visibility mask

Member Data Documentation

◆ antiAliasing

unsigned int antiAliasing = 4
protected

Anti-aliasing level.

◆ backgroundMaterial

MaterialPtr backgroundMaterial
protected

Background material of the render target.

◆ backgroundMaterialDirty

bool backgroundMaterialDirty = false
protected

Flag to indicate if the render target background material has changed.

◆ colorDirty

bool colorDirty = true
protected

Flag to indicate if the render target color has changed.

◆ material

MaterialPtr material
protected

a material used by for the render target

◆ materialApplicator

Ogre2RenderTargetMaterialPtr materialApplicator
protected

Helper class that applies the material to the render target.

◆ ogreBackgroundColor

Ogre::ColourValue ogreBackgroundColor
protected

Stores the background color of the render target.

◆ ogreCamera

Ogre::Camera* ogreCamera = nullptr
protected

Pointer to the internal ogre camera.

◆ ogreCompositorWorkspace

Ogre::CompositorWorkspace* ogreCompositorWorkspace = nullptr
protected

Ogre's compositor workspace - the main interface to render into a render target or render texture.

◆ ogreCompositorWorkspaceDefName

std::string ogreCompositorWorkspaceDefName
protected

Ogre's compositor workspace definition name.

◆ visibilityMask

uint32_t visibilityMask = IGN_VISIBILITY_ALL
protected

visibility mask associated with this render target


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