Ogre2.x implementation of the CiVctCascade class. More...
#include <Ogre2GlobalIlluminationCiVct.hh>
Public Member Functions | |
Ogre2CiVctCascade () | |
Constructor. | |
~Ogre2CiVctCascade () override | |
virtual gz::math::Vector3d | AreaHalfSize () const override |
Returns area in units around the camera to voxelize. | |
virtual bool | AutoMultiplier () const override |
Retrieve current setting. See SetAutoMultiplier. | |
virtual gz::math::Vector3d | CameraStepSize () const override |
Returns the camera step size. | |
virtual bool | CorrectAreaLightShadows () const override |
Retrieve current setting. See SetCorrectAreaLightShadows. | |
void | Init (Ogre::VctCascadeSetting *_cascade, const CiVctCascade *_ref) |
Initializes the cascade. | |
virtual const uint32_t * | OctantCount () const override |
Returns number of octant subdivisions per axis. | |
void | ReInit (Ogre::VctCascadeSetting *_cascade) |
Re-initializes the cascade. See Ogre2GlobalIlluminationCiVct::Reset. | |
virtual const uint32_t * | Resolution () const override |
Returns 3D Voxel resolution. | |
virtual void | SetAreaHalfSize (const gz::math::Vector3d &_areaHalfSize) override |
The area in units around the camera to voxelize Each cascade area size must be >= than the previous one i.e. assert( cascade[i]->AreaHalfSize >= cascade[i-1]->AreaHalfSize );. | |
virtual void | SetAutoMultiplier (bool _autoMultiplier) override |
Whether we should calculate the ideal multiplier based on lights on scene to minimize quantization loss from storing all GI data in RGBA8_UNORM_sRGB (which is not enough for HDR). For more info see Ogre's VctLighting::setBakingMultiplier. | |
virtual void | SetCameraStepSize (const gz::math::Vector3d &_stepSize) override |
How much we let the camera move before updating the cascade Value is in range [1; inf) | |
virtual void | SetCorrectAreaLightShadows (bool _correctAreaLightShadows) override |
Sets whether to correctly calculate GI occlusion caused by occluders against area lights. Consumes more VRAM. This option is not needed if you're not using area lights. | |
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 but it may also decrease it. Profiling is required for each scene. | |
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 CiVctCascade::SetThinWallCounter. | |
Public Member Functions inherited from CiVctCascade | |
CiVctCascade () | |
Constructor. | |
virtual | ~CiVctCascade () |
Destructor. | |
Detailed Description
Ogre2.x implementation of the CiVctCascade class.
Constructor & Destructor Documentation
◆ Ogre2CiVctCascade()
|
explicit |
Constructor.
◆ ~Ogre2CiVctCascade()
|
override |
Member Function Documentation
◆ AreaHalfSize()
|
overridevirtual |
Returns area in units around the camera to voxelize.
- Returns
- area in units around the camera to voxelize
Implements CiVctCascade.
◆ AutoMultiplier()
|
overridevirtual |
Retrieve current setting. See SetAutoMultiplier.
- Returns
- True if the feature is enabled
Implements CiVctCascade.
◆ CameraStepSize()
|
overridevirtual |
◆ CorrectAreaLightShadows()
|
overridevirtual |
Retrieve current setting. See SetCorrectAreaLightShadows.
- Returns
- True if the feature is enabled
Implements CiVctCascade.
◆ Init()
void Init | ( | Ogre::VctCascadeSetting * | _cascade, |
const CiVctCascade * | _ref | ||
) |
Initializes the cascade.
- Parameters
-
[in] _cascade Cascade we control [in] _ref Reference to clone settings from (can be nullptr)
◆ OctantCount()
|
overridevirtual |
Returns number of octant subdivisions per axis.
- Returns
- Octant subdivisions. Length of array is 3
Implements CiVctCascade.
◆ ReInit()
void ReInit | ( | Ogre::VctCascadeSetting * | _cascade | ) |
Re-initializes the cascade. See Ogre2GlobalIlluminationCiVct::Reset.
- Parameters
-
[in] _cascade Cascade we control. All data already filled.
◆ Resolution()
|
overridevirtual |
Returns 3D Voxel resolution.
- Returns
- Resolution in each axis. Length of array is 3
Implements CiVctCascade.
◆ SetAreaHalfSize()
|
overridevirtual |
The area in units around the camera to voxelize Each cascade area size must be >= than the previous one i.e. assert( cascade[i]->AreaHalfSize >= cascade[i-1]->AreaHalfSize );.
For best results, area half sizes from each cascade should be multiples of each other
- Parameters
-
[in] _areaHalfSize
Implements CiVctCascade.
◆ SetAutoMultiplier()
|
overridevirtual |
Whether we should calculate the ideal multiplier based on lights on scene to minimize quantization loss from storing all GI data in RGBA8_UNORM_sRGB (which is not enough for HDR). For more info see Ogre's VctLighting::setBakingMultiplier.
- Parameters
-
[in] _autoMultiplier True to enable the feature. Default.
Implements CiVctCascade.
◆ SetCameraStepSize()
|
overridevirtual |
How much we let the camera move before updating the cascade Value is in range [1; inf)
Camera is evaluated in quantized steps. i.e. stepSize = cameraStepSize * 2.0 * areaHalfSize / resolution stepSize = cameraStepSize * getVoxelCellSize()
If cameraStepSize = 1, after the camera moves stepSize units, we will move & update the cascades If cameraStepSize = 2, after the camera moves 2 * stepSize units, we will move & update the cascades
Small step sizes may cause too much brightness jumping as VCT may not be stable. Very big step sizes may cause periodic performance spikes or sudden changes in brightness.
- Parameters
-
[in] _stepSize Step size in units
Implements CiVctCascade.
◆ SetCorrectAreaLightShadows()
|
overridevirtual |
Sets whether to correctly calculate GI occlusion caused by occluders against area lights. Consumes more VRAM. This option is not needed if you're not using area lights.
- Remarks
- Recommended setting is true for the first cascade, false for the rest. Or just false if you don't plan on using area lights (saves memory and performance)
- Parameters
-
[in] _correctAreaLightShadows True to enable the feature
Implements CiVctCascade.
◆ SetOctantCount()
|
overridevirtual |
Number of divisions per axis to divide the scene into multiple octants. Setting this value > 1 may improve voxelization performance but it may also decrease it. Profiling is required for each scene.
- Parameters
-
[in] _octants Number of octant subdivisions per axis
Implements CiVctCascade.
◆ SetResolution()
|
overridevirtual |
Resolution of the 3D Voxel. Must be multiple of 2.
- Parameters
-
[in] _resolution Resolution
Implements CiVctCascade.
◆ 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 CiVctCascade.
◆ ThinWallCounter()
|
overridevirtual |
The documentation for this class was generated from the following file: