Ogre2.x implementation of the GlobalIlluminationVct class. More...
#include <Ogre2GlobalIlluminationVct.hh>
Public Member Functions | |
virtual | ~Ogre2GlobalIlluminationVct () override |
Destructor. | |
virtual bool | Anisotropic () const override |
Whether anisotropic setting is on. | |
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 | ConserveMemory () const override |
Whether we're releasing memory as fast as possible. | |
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 const uint32_t * | OctantCount () const override |
Returns number of octant subdivisions per axis. | |
uint32_t | ParticipatingVisuals () const override |
Visuals that can bounce GI. | |
virtual const uint32_t * | Resolution () const override |
Returns 3D Voxel resolution. | |
virtual void | SetAnisotropic (bool _anisotropic) override |
Anisotropic VCT provides much higher quality because it better captures incoming indirect illumination from all directions. | |
virtual void | SetBounceCount (uint32_t _bounceCount) override |
Set the number of GI bounces. Very high number can cause a large performance impact. | |
virtual void | SetConserveMemory (bool _conserveMemory) override |
This will try to release resources that aren't needed when lights and static objects don't change. | |
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 | SetOctantCount (const uint32_t _octants[3]) override |
Number of divisions per axis to divide the scene into multiple octants. Setting this value > 1 may improve voxelization performance when there is a lot of static Meshes; but it may also decrease it. Profiling is required for each scene. | |
void | SetParticipatingVisuals (uint32_t _mask) override |
Set which visuals can bounce GI. | |
virtual void | SetResolution (const uint32_t _resolution[3]) override |
Resolution of the 3D Voxel. Must be multiple of 2. | |
virtual void | SetThinWallCounter (float _thinWallCounter) override |
Shadows are calculated by raymarching towards the light source. However sometimes the ray 'may go through' a wall due to how bilinear interpolation works. | |
virtual float | ThinWallCounter () const override |
Value of SetThinWallCounter. | |
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 BaseGlobalIlluminationVct< Ogre2Object > | |
virtual | ~BaseGlobalIlluminationVct () |
Public Member Functions inherited from GlobalIlluminationVct | |
GlobalIlluminationVct () | |
Constructor. | |
virtual | ~GlobalIlluminationVct () |
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 | |
Ogre2GlobalIlluminationVct () | |
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 BaseGlobalIlluminationVct< Ogre2Object > | |
BaseGlobalIlluminationVct () | |
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 GlobalIlluminationVct | |
enum | DebugVisualizationMode { DVM_Albedo , DVM_Normal , DVM_Emissive , DVM_Lighting , DVM_None } |
Debug visualization modes for GlobalIlluminationVct::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 GlobalIlluminationVct class.
Constructor & Destructor Documentation
◆ Ogre2GlobalIlluminationVct()
|
protected |
Constructor.
◆ ~Ogre2GlobalIlluminationVct()
|
overridevirtual |
Destructor.
Member Function Documentation
◆ Anisotropic()
|
overridevirtual |
Whether anisotropic setting is on.
- Returns
- Anisotropy setting
Reimplemented from BaseGlobalIlluminationVct< Ogre2Object >.
◆ BounceCount()
|
overridevirtual |
◆ Build()
|
overridevirtual |
Build the internal structures required for producing GI This function may take significant time.
Implements GlobalIlluminationBase.
◆ ConserveMemory()
|
overridevirtual |
Whether we're releasing memory as fast as possible.
- Returns
- Conserve Memory setting
Reimplemented from BaseGlobalIlluminationVct< Ogre2Object >.
◆ 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
Reimplemented from BaseGlobalIlluminationVct< Ogre2Object >.
◆ Init()
|
overrideprotectedvirtual |
Initialize the class.
Implements GlobalIlluminationBase.
◆ LightingChanged()
|
overridevirtual |
Called by Scene when lighting changes so that GI can be updated.
Implements GlobalIlluminationVct.
◆ OctantCount()
|
overridevirtual |
Returns number of octant subdivisions per axis.
- Returns
- Octant subdivisions. Length of array is 3
Reimplemented from BaseGlobalIlluminationVct< Ogre2Object >.
◆ ParticipatingVisuals()
|
overridevirtual |
◆ Resolution()
|
overridevirtual |
Returns 3D Voxel resolution.
- Returns
- Resolution in each axis. Length of array is 3
Reimplemented from BaseGlobalIlluminationVct< Ogre2Object >.
◆ SetAnisotropic()
|
overridevirtual |
Anisotropic VCT provides much higher quality because it better captures incoming indirect illumination from all directions.
However it consumes more VRAM and is slower. Recommended: true
- Remarks
- This setting has nothing to do with anistropic texture filtering in GPUs
- Parameters
-
[in] _anisotropic Anisotropy setting
Reimplemented from BaseGlobalIlluminationVct< Ogre2Object >.
◆ 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.
◆ SetConserveMemory()
|
overridevirtual |
This will try to release resources that aren't needed when lights and static objects don't change.
When true, every time light changes we will recreate those resources, update the GI, and release them; causing VRAM spikes. This can be bad for memory fragmentation (and performance) if VCT is updated too often.
When false, those resources will stay loaded at all times
- Parameters
-
[in] _conserveMemory True to release memory as fast as possible
Reimplemented from BaseGlobalIlluminationVct< Ogre2Object >.
◆ 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 GlobalIlluminationVct.
◆ 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
Reimplemented from BaseGlobalIlluminationVct< Ogre2Object >.
◆ SetOctantCount()
|
overridevirtual |
Number of divisions per axis to divide the scene into multiple octants. Setting this value > 1 may improve voxelization performance when there is a lot of static Meshes; but it may also decrease it. Profiling is required for each scene.
- Parameters
-
[in] _octants Number of octant subdivisions per axis
Reimplemented from BaseGlobalIlluminationVct< Ogre2Object >.
◆ SetParticipatingVisuals()
|
overridevirtual |
Set which visuals can bounce GI.
- Parameters
-
[in] _mask See ParticipatingVisualsFlags
Implements GlobalIlluminationBase.
◆ SetResolution()
|
overridevirtual |
Resolution of the 3D Voxel. Must be multiple of 2.
- Remarks
- To avoid wasting RAM, make this function your first call if you intend to change the defaults.
- Parameters
-
[in] _resolution Resolution
Reimplemented from BaseGlobalIlluminationVct< Ogre2Object >.
◆ SetThinWallCounter()
|
overridevirtual |
Shadows are calculated by raymarching towards the light source. However sometimes the ray 'may go through' a wall due to how bilinear interpolation works.
Bilinear interpolation can produce nicer soft shadows, but it can also cause this light leaking from behind a wall.
Increase this value (e.g. to 2.0f) to fight light leaking. This should generally (over-)darken the scene
Lower values will lighten the scene and allow more light leaking
Note that thinWallCounter can not fight all sources of light leaking, thus increasing it to ridiculous high values may not yield any benefit.
- Parameters
-
[in] _thinWallCounter Value in range (0; inf)
Implements GlobalIlluminationVct.
◆ ThinWallCounter()
|
overridevirtual |
◆ 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: