Gazebo Rendering

API Reference

9.0.0~pre2
Ogre2GlobalIlluminationCiVct Class Reference

Ogre2.x implementation of the GlobalIlluminationCiVct class. More...

#include <Ogre2GlobalIlluminationCiVct.hh>

Public Member Functions

virtual ~Ogre2GlobalIlluminationCiVct () override
 Destructor.
 
virtual CiVctCascadePtr AddCascade (const CiVctCascade *_ref) override
 Adds a new cascade.
 
virtual bool Anisotropic () const override
 Whether anisotropic setting is on.
 
virtual void AutoCalculateStepSizes (const gz::math::Vector3d &_stepSize) override
 Alters each cascade's step size. The last cascade is set to stepSize. The rest of the cascades are set to step sizes that are >= stepSize automatically. Should be called after adding all cascades.
 
virtual void Bind (const CameraPtr &_camera) override
 CIVCT relies on having multiple cascades around a central position, typically a camera. This function binds a camera for us to monitor and will act as the center of those cascades.
 
virtual uint32_t BounceCount () const override
 Get number of bounces.
 
virtual void Build () override
 Build the internal structures required for producing GI This function may take significant time.
 
virtual bool ConsistentCascadeSteps () const override
 Retrieve current setting. See SetConsistentCascadeSteps.
 
virtual DebugVisualizationMode DebugVisualization () const override
 Returns current visualization mode.
 
virtual void Destroy () override
 Destroy the class.
 
virtual bool Enabled () const override
 Returns true if this GI configuration is currently enabled.
 
virtual bool HighQuality () const override
 Whether we're using 6 (true) or 4 (false) cones.
 
virtual void LightingChanged () override
 Called by Scene when lighting changes so that GI can be updated.
 
virtual void NewSettings (uint32_t _bounceCount, bool _anisotropic) override
 Sets new settings after having called Init.
 
uint32_t ParticipatingVisuals () const override
 Visuals that can bounce GI.
 
virtual void PopCascade () override
 Removes the last added cascade.
 
virtual void Reset () override
 Disables this GI and undoes the internal work performed by Start(). This makes it possible to edit cascades again.
 
virtual void SetBounceCount (uint32_t _bounceCount) override
 Set the number of GI bounces. Very high number can cause a large performance impact.
 
virtual void SetConsistentCascadeSteps (bool _consistentCascadeSteps) override
 Selects how we determine when we need to (partially) rebuild the voxels based on camera movement.
 
virtual void SetDebugVisualization (DebugVisualizationMode _dvm) override
 Draws the voxels on screen for inspection and understand what is going on with GI. You should be looking at a minecraft-like world.
 
virtual void SetHighQuality (bool _highQuality) override
 True for high quality (slower). VRAM consumption stays the same. Ogre2 will use 6 cones instead of 4.
 
virtual void SetMaxCascades (const uint32_t _maxCascades) override
 Tells how many times AddCascade will be called. You can call it fewer times (i.e. some kb of RAM will be wasted) but not more.
 
void SetParticipatingVisuals (uint32_t _mask) override
 Set which visuals can bounce GI.
 
virtual void Start (uint32_t _bounceCount, bool _anisotropic) override
 Call this function after adding all cascades. You can no longer add cascades after this.
 
virtual bool Started () const override
 Returns true if Start() has already been called. Will return false again if Reset() is called.
 
virtual void UpdateCamera () override
 Called by Scene on an active GlobalIlluminationBase whenever first rendering happens for a new frame. This implies Build has been called already.
 
virtual void UpdateLighting () override
 Called by Scene on an active GlobalIlluminationBase whenever lighting changes. This implies Build has been called already.
 
- Public Member Functions inherited from GlobalIlluminationCiVct
 GlobalIlluminationCiVct ()
 Constructor.
 
virtual ~GlobalIlluminationCiVct ()
 Destructor.
 
- Public Member Functions inherited from GlobalIlluminationBase
 GlobalIlluminationBase ()
 Constructor.
 
virtual ~GlobalIlluminationBase ()
 Destructor.
 
- Public Member Functions inherited from Ogre2Object
virtual ~Ogre2Object ()
 Destructor.
 
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
 
virtual void PostRender () override
 
virtual void PreRender () override
 

Protected Member Functions

 Ogre2GlobalIlluminationCiVct ()
 Constructor.
 
virtual void Init () override
 Initialize the class.
 
virtual void SetEnabled (bool _enabled) override
 Sets this GI solution as enabled.
 
- Protected Member Functions inherited from Ogre2Object
 Ogre2Object ()
 Constructor.
 
- Protected Member Functions inherited from BaseObject
 BaseObject ()
 
virtual void Load ()
 

Additional Inherited Members

- Public Types inherited from GlobalIlluminationCiVct
enum  DebugVisualizationMode {
  DVM_Albedo , DVM_Normal , DVM_Emissive , DVM_Lighting ,
  DVM_None
}
 Debug visualization modes for GlobalIlluminationCiVct::SetDebugVisualization. More...
 
- Public Types inherited from GlobalIlluminationBase
enum  ParticipatingVisualsFlags { DYNAMIC_VISUALS = 1u << 0u , STATIC_VISUALS = 1u << 1u }
 Bitmask of which objects are considered by GI bounces. Note that all objects can receive indirect illumination. More...
 
- Protected Attributes inherited from Ogre2Object
Ogre2ScenePtr scene
 Pointer to the ogre scene.
 
- Protected Attributes inherited from BaseObject
unsigned int id
 
std::string name
 

Detailed Description

Ogre2.x implementation of the GlobalIlluminationCiVct class.

Constructor & Destructor Documentation

◆ Ogre2GlobalIlluminationCiVct()

Constructor.

◆ ~Ogre2GlobalIlluminationCiVct()

virtual ~Ogre2GlobalIlluminationCiVct ( )
overridevirtual

Destructor.

Member Function Documentation

◆ AddCascade()

virtual CiVctCascadePtr AddCascade ( const CiVctCascade _ref)
overridevirtual

Adds a new cascade.

Remarks
Cannot be called anymore after Start() has been called
Parameters
[in]_refCan be nullptr. If you already have a cascade, we will clone its settings.
Returns
New Cascade to control its settings.

Implements GlobalIlluminationCiVct.

◆ Anisotropic()

virtual bool Anisotropic ( ) const
overridevirtual

Whether anisotropic setting is on.

Returns
Anisotropy setting

Implements GlobalIlluminationCiVct.

◆ AutoCalculateStepSizes()

virtual void AutoCalculateStepSizes ( const gz::math::Vector3d _stepSize)
overridevirtual

Alters each cascade's step size. The last cascade is set to stepSize. The rest of the cascades are set to step sizes that are >= stepSize automatically. Should be called after adding all cascades.

Parameters
[in]_stepSizeSee CiVctCascade::SetCameraStepSize

Implements GlobalIlluminationCiVct.

◆ Bind()

virtual void Bind ( const CameraPtr _camera)
overridevirtual

CIVCT relies on having multiple cascades around a central position, typically a camera. This function binds a camera for us to monitor and will act as the center of those cascades.

Remarks
If no camera is bound, the active camera will be used, which can cause performance problems if multiple sensors are present
Parameters
[in]_cameraCamera to bind. Nullptr to unbind.

Implements GlobalIlluminationCiVct.

◆ BounceCount()

virtual uint32_t BounceCount ( ) const
overridevirtual

Get number of bounces.

Returns
Number of bounces

Implements GlobalIlluminationBase.

◆ Build()

virtual void Build ( )
overridevirtual

Build the internal structures required for producing GI This function may take significant time.

Implements GlobalIlluminationBase.

◆ ConsistentCascadeSteps()

virtual bool ConsistentCascadeSteps ( ) const
overridevirtual

Retrieve current setting. See SetConsistentCascadeSteps.

Returns
True if the feature is enabled

Implements GlobalIlluminationCiVct.

◆ DebugVisualization()

virtual DebugVisualizationMode DebugVisualization ( ) const
overridevirtual

Returns current visualization mode.

Returns
Visualization mode

Implements GlobalIlluminationCiVct.

◆ Destroy()

virtual void Destroy ( )
overridevirtual

Destroy the class.

Implements GlobalIlluminationBase.

◆ Enabled()

virtual bool Enabled ( ) const
overridevirtual

Returns true if this GI configuration is currently enabled.

Returns
True if this GI solution is currently enabled

Implements GlobalIlluminationBase.

◆ HighQuality()

virtual bool HighQuality ( ) const
overridevirtual

Whether we're using 6 (true) or 4 (false) cones.

Returns
High Quality setting

Implements GlobalIlluminationCiVct.

◆ Init()

virtual void Init ( )
overrideprotectedvirtual

Initialize the class.

Implements GlobalIlluminationBase.

◆ LightingChanged()

virtual void LightingChanged ( )
overridevirtual

Called by Scene when lighting changes so that GI can be updated.

Implements GlobalIlluminationCiVct.

◆ NewSettings()

virtual void NewSettings ( uint32_t  _bounceCount,
bool  _anisotropic 
)
overridevirtual

Sets new settings after having called Init.

Parameters
[in]_bounceCountSee Start
[in]_anisotropicSee Start

Implements GlobalIlluminationCiVct.

◆ ParticipatingVisuals()

uint32_t ParticipatingVisuals ( ) const
overridevirtual

Visuals that can bounce GI.

Returns
See ParticipatingVisualsFlags

Implements GlobalIlluminationBase.

◆ PopCascade()

virtual void PopCascade ( )
overridevirtual

Removes the last added cascade.

Remarks
Do NOT try to call any of the functions of the CiVctCascadePtr returned by AddCascade after this call.
Cannot be called anymore after Start() has been called

Implements GlobalIlluminationCiVct.

◆ Reset()

virtual void Reset ( )
overridevirtual

Disables this GI and undoes the internal work performed by Start(). This makes it possible to edit cascades again.

Implements GlobalIlluminationCiVct.

◆ SetBounceCount()

virtual void SetBounceCount ( uint32_t  _bounceCount)
overridevirtual

Set the number of GI bounces. Very high number can cause a large performance impact.

Parameters
[in]_bounceCountValue in range [0; inf)

Implements GlobalIlluminationBase.

◆ SetConsistentCascadeSteps()

virtual void SetConsistentCascadeSteps ( bool  _consistentCascadeSteps)
overridevirtual

Selects how we determine when we need to (partially) rebuild the voxels based on camera movement.

Remarks
If camera movement is deterministic, output is always deterministic regardless of this setting
Parameters
[in]_consistentCascadeStepsTrue: Results can feel very determnistic because it is predictable.

Camera position is quantized in voxelCellSize * cascade.cameraStepSize. This means the camera position is in a 'cell' or 'grid'.

When the camera position moves onto another grid, we partially revoxelize results.

Advantage: A camera at pos XYZ will always have the same results

Disadvantage: if the camera jumps back and forth between voxels, revoxelizations will trigger frequently causing obvious frequent jumps in brightness

False: Revoxelization happens after the camera has travelled cascade.cameraStepSize cells away from the last point of voxelization.

Advantage: Infrequent revoxelizations. If camera movement is restricted around the last voxelization point, we will never revoxelize.

Disadvantage: Taking a picture at pos XYZ, then going away, and taking another picture at same pos XYZ may not result in the same brightness / image; which can make it feel unpredictable or non-deterministic. This can be workarounded by temporarily setting SetConsistentCascadeSteps(true) then back false after taking the picture

Implements GlobalIlluminationCiVct.

◆ SetDebugVisualization()

virtual void SetDebugVisualization ( DebugVisualizationMode  _dvm)
overridevirtual

Draws the voxels on screen for inspection and understand what is going on with GI. You should be looking at a minecraft-like world.

Parameters
[in]_dvmWhat component to visualize

Implements GlobalIlluminationCiVct.

◆ SetEnabled()

virtual void SetEnabled ( bool  _enabled)
overrideprotectedvirtual

Sets this GI solution as enabled.

Remarks
Only one GI solution can be active at the same time
See also
Scene::SetActiveGlobalIllumination
Parameters
[in]_enabledTrue to enable, false otherwise

Implements GlobalIlluminationBase.

◆ SetHighQuality()

virtual void SetHighQuality ( bool  _highQuality)
overridevirtual

True for high quality (slower). VRAM consumption stays the same. Ogre2 will use 6 cones instead of 4.

Parameters
[in]_highQualityQuality setting

Implements GlobalIlluminationCiVct.

◆ SetMaxCascades()

virtual void SetMaxCascades ( const uint32_t  _maxCascades)
overridevirtual

Tells how many times AddCascade will be called. You can call it fewer times (i.e. some kb of RAM will be wasted) but not more.

Remarks
You can't call this function after adding cascades The semantics are similar to std::vector::reserve
Parameters
[in]_maxCascadesNumber of times AddCascade will be called

Implements GlobalIlluminationCiVct.

◆ SetParticipatingVisuals()

void SetParticipatingVisuals ( uint32_t  _mask)
overridevirtual

Set which visuals can bounce GI.

Parameters
[in]_maskSee ParticipatingVisualsFlags

Implements GlobalIlluminationBase.

◆ Start()

virtual void Start ( uint32_t  _bounceCount,
bool  _anisotropic 
)
overridevirtual

Call this function after adding all cascades. You can no longer add cascades after this.

Parameters
[in]_bounceCountNumber of bounces for cascade 0. The rest of the cascades are autocalculated to maintain even brightness levels.

Range is [0; inf) but a value of 0 is strongly discouraged if you have more than 1 cascade as you can end up with very uneven brightness levels between cascades For more info see Ogre's VctLighting::update

Parameters
[in]_anisotropicWhether we should use anisotropic VCT (higher quality, but consumes more VRAM). See GlobalIlluminationVct::SetAnisotropic

Implements GlobalIlluminationCiVct.

◆ Started()

virtual bool Started ( ) const
overridevirtual

Returns true if Start() has already been called. Will return false again if Reset() is called.

Returns
true if Start() has already been called

Implements GlobalIlluminationCiVct.

◆ UpdateCamera()

virtual void UpdateCamera ( )
overridevirtual

Called by Scene on an active GlobalIlluminationBase whenever first rendering happens for a new frame. This implies Build has been called already.

Implements GlobalIlluminationBase.

◆ UpdateLighting()

virtual void UpdateLighting ( )
overridevirtual

Called by Scene on an active GlobalIlluminationBase whenever lighting changes. This implies Build has been called already.

Implements GlobalIlluminationBase.


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