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()
|
protected |
Constructor.
◆ ~Ogre2GlobalIlluminationCiVct()
|
overridevirtual |
Destructor.
Member Function Documentation
◆ AddCascade()
|
overridevirtual |
Adds a new cascade.
- Remarks
- Cannot be called anymore after Start() has been called
- Parameters
-
[in] _ref Can be nullptr. If you already have a cascade, we will clone its settings.
- Returns
- New Cascade to control its settings.
Implements GlobalIlluminationCiVct.
◆ Anisotropic()
|
overridevirtual |
◆ AutoCalculateStepSizes()
|
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] _stepSize See CiVctCascade::SetCameraStepSize
Implements GlobalIlluminationCiVct.
◆ Bind()
|
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] _camera Camera to bind. Nullptr to unbind.
Implements GlobalIlluminationCiVct.
◆ BounceCount()
|
overridevirtual |
◆ Build()
|
overridevirtual |
Build the internal structures required for producing GI This function may take significant time.
Implements GlobalIlluminationBase.
◆ ConsistentCascadeSteps()
|
overridevirtual |
Retrieve current setting. See SetConsistentCascadeSteps.
- Returns
- True if the feature is enabled
Implements GlobalIlluminationCiVct.
◆ DebugVisualization()
|
overridevirtual |
◆ Destroy()
|
overridevirtual |
Destroy the class.
Implements GlobalIlluminationBase.
◆ Enabled()
|
overridevirtual |
Returns true if this GI configuration is currently enabled.
- Returns
- True if this GI solution is currently enabled
Implements GlobalIlluminationBase.
◆ HighQuality()
|
overridevirtual |
Whether we're using 6 (true) or 4 (false) cones.
- Returns
- High Quality setting
Implements GlobalIlluminationCiVct.
◆ Init()
|
overrideprotectedvirtual |
Initialize the class.
Implements GlobalIlluminationBase.
◆ LightingChanged()
|
overridevirtual |
Called by Scene when lighting changes so that GI can be updated.
Implements GlobalIlluminationCiVct.
◆ NewSettings()
|
overridevirtual |
Sets new settings after having called Init.
- Parameters
-
[in] _bounceCount See Start [in] _anisotropic See Start
Implements GlobalIlluminationCiVct.
◆ ParticipatingVisuals()
|
overridevirtual |
◆ 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()
|
overridevirtual |
Disables this GI and undoes the internal work performed by Start(). This makes it possible to edit cascades again.
Implements GlobalIlluminationCiVct.
◆ SetBounceCount()
|
overridevirtual |
Set the number of GI bounces. Very high number can cause a large performance impact.
- Parameters
-
[in] _bounceCount Value in range [0; inf)
Implements GlobalIlluminationBase.
◆ SetConsistentCascadeSteps()
|
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] _consistentCascadeSteps True: 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()
|
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] _dvm What component to visualize
Implements GlobalIlluminationCiVct.
◆ SetEnabled()
|
overrideprotectedvirtual |
Sets this GI solution as enabled.
- Remarks
- Only one GI solution can be active at the same time
- Parameters
-
[in] _enabled True to enable, false otherwise
Implements GlobalIlluminationBase.
◆ SetHighQuality()
|
overridevirtual |
True for high quality (slower). VRAM consumption stays the same. Ogre2 will use 6 cones instead of 4.
- Parameters
-
[in] _highQuality Quality setting
Implements GlobalIlluminationCiVct.
◆ SetMaxCascades()
|
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] _maxCascades Number of times AddCascade will be called
Implements GlobalIlluminationCiVct.
◆ SetParticipatingVisuals()
|
overridevirtual |
Set which visuals can bounce GI.
- Parameters
-
[in] _mask See ParticipatingVisualsFlags
Implements GlobalIlluminationBase.
◆ Start()
|
overridevirtual |
Call this function after adding all cascades. You can no longer add cascades after this.
- Parameters
-
[in] _bounceCount Number 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] _anisotropic Whether we should use anisotropic VCT (higher quality, but consumes more VRAM). See GlobalIlluminationVct::SetAnisotropic
Implements GlobalIlluminationCiVct.
◆ Started()
|
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()
|
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()
|
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: