CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::VoxelConeTracingSettings Struct Referencefinal

A structure that allows the user to customize the Voxel Cone Tracing algorithm parameters. More...

#include <CeresEngine/Renderer/RendererCameraSettings.hpp>

Static Public Member Functions

template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 

Public Attributes

UInt32 volumeDimension = 256
 The resolution used by the voxel image.
 
bool normalWeightedLambert = true
 A disadvantage of this technique is the loss of precision averaging all the geometry normals within a voxel.
 
bool useShadowMapIfAvailable = true
 Allows the algorithm to reuse a shadow map if available.
 
UInt32 voxelUpdateChunkSize = 8
 To avoid recomputing the voxel frequently, the scene is only revoxelized once the camera has moved several voxels.
 
double maximumVolumeGridSize = 60.0
 By default, the scene is voxelized up to the camera's far plane distance, however depending on the camera configuration this can yield voxels that represent several meters in world-space.
 
UInt32 bounces = 1
 The number of light bounces to propagate.
 
bool traceDiffuse = true
 If set to true, will trace 6 cones that compound the diffuse global illumination component.
 
double diffuseSamplingFactor = 0.9
 The factor to increase the cone radius each iteration of the diffuse component.
 
double diffuseMaxTracingDistance = 1.0
 The maximum voxel distance to trace a cone.
 
double diffuseBounceStrength = 1.0
 A multiplier to the applied to the bounced light strength.
 
bool traceSimplifiedDiffuseCone = false
 Traces a unique and simplified diffuse cone.
 
bool traceNormalOrientedDiffuseCone = true
 If set to true will trace diffuse cones around the normal vector.
 
bool traceSpecular = true
 Whether the specular cone should be traced.
 
double specularSamplingFactor = 0.9
 The factor to increase the cone radius each iteration of the specular component.
 
double specularMaxTracingDistance = 1.0
 The maximum voxel distance to trace a cone.
 
double specularBounceStrength = 1.0
 A multiplier to the applied to the bounced light strength.
 
bool traceAmbientOcclusion = true
 Disables ambient occlusion tracing.
 
double ambientOcclusionFalloff = 725.0
 The falloff to be applied when computing ambient occlusion.
 
double ambientOcclusionAlpha = 0.01
 The alpha value to be added when computing ambient occlusion.
 
double emissiveInjectionFactor = 100.0
 A factor that gets multiplied with the material emissive component to help deal with low-precision emissive voxel image.
 
double scalingFactor = 1.0
 If set to anything other than 1.0, the indirect illumination will be computed on a smaller or larger image and up sampled to screen size after completing the cone tracing procedure.
 
bool scalingMultisampling = true
 If enabled and scaling is enabled, will sample 9 texels from the scaled indirect lighting image in order to smooth artifacts that can be created by upsampling.
 
bool alwaysVoxelize = false
 Always voxelizes the scene.
 
bool alwaysInjectRadiance = false
 Always inject radiance.
 
bool debug = false
 If set to true, will render the voxelized scene.
 

Detailed Description

A structure that allows the user to customize the Voxel Cone Tracing algorithm parameters.

Deferred voxel shading is a four-step real-time global illumination technique inspired by voxel cone tracing and deferred rendering. This approach enables us to obtain an accurate approximation of a plethora of indirect illumination effects including: indirect diffuse, specular reflectance, color-blending, emissive materials, indirect shadows and ambient occlusion.

Based on: https://github.com/jose-villegas/VCTRenderer

Member Function Documentation

◆ reflect()

template<typename Processor >
static constexpr void CeresEngine::VoxelConeTracingSettings::reflect ( Processor &&  RTTI)
inlinestaticconstexpr

Executes the given processor for every field of the struct.

Parameters
RTTIThe processor to be ran for every field.

Member Data Documentation

◆ alwaysInjectRadiance

bool CeresEngine::VoxelConeTracingSettings::alwaysInjectRadiance = false

Always inject radiance.

◆ alwaysVoxelize

bool CeresEngine::VoxelConeTracingSettings::alwaysVoxelize = false

Always voxelizes the scene.

◆ ambientOcclusionAlpha

double CeresEngine::VoxelConeTracingSettings::ambientOcclusionAlpha = 0.01

The alpha value to be added when computing ambient occlusion.

◆ ambientOcclusionFalloff

double CeresEngine::VoxelConeTracingSettings::ambientOcclusionFalloff = 725.0

The falloff to be applied when computing ambient occlusion.

◆ bounces

UInt32 CeresEngine::VoxelConeTracingSettings::bounces = 1

The number of light bounces to propagate.

◆ debug

bool CeresEngine::VoxelConeTracingSettings::debug = false

If set to true, will render the voxelized scene.

◆ diffuseBounceStrength

double CeresEngine::VoxelConeTracingSettings::diffuseBounceStrength = 1.0

A multiplier to the applied to the bounced light strength.

◆ diffuseMaxTracingDistance

double CeresEngine::VoxelConeTracingSettings::diffuseMaxTracingDistance = 1.0

The maximum voxel distance to trace a cone.

1.0 will trace the entire voxel volume.

◆ diffuseSamplingFactor

double CeresEngine::VoxelConeTracingSettings::diffuseSamplingFactor = 0.9

The factor to increase the cone radius each iteration of the diffuse component.

◆ emissiveInjectionFactor

double CeresEngine::VoxelConeTracingSettings::emissiveInjectionFactor = 100.0

A factor that gets multiplied with the material emissive component to help deal with low-precision emissive voxel image.

◆ maximumVolumeGridSize

double CeresEngine::VoxelConeTracingSettings::maximumVolumeGridSize = 60.0

By default, the scene is voxelized up to the camera's far plane distance, however depending on the camera configuration this can yield voxels that represent several meters in world-space.

Changing this parameter will cause the volume grid size to be truncated to the smaller number between this and the camera's far plane.

◆ normalWeightedLambert

bool CeresEngine::VoxelConeTracingSettings::normalWeightedLambert = true

A disadvantage of this technique is the loss of precision averaging all the geometry normals within a voxel.

The resulting averaged normal may end up pointing towards a non-convenient direction. This problem is notable when the normal vectors within the space of a voxel are uneven. To reduce this issue we utilize a normal-weighted attenuation, where first the normal attenuation is calculated per every face of the voxel.

◆ scalingFactor

double CeresEngine::VoxelConeTracingSettings::scalingFactor = 1.0

If set to anything other than 1.0, the indirect illumination will be computed on a smaller or larger image and up sampled to screen size after completing the cone tracing procedure.

If using a smaller value, performance will be increased at the cost of more pixelization and low-resolution artifacts. If higher, will yield a global illumination output with less aliasing but will significantly affect performance.

◆ scalingMultisampling

bool CeresEngine::VoxelConeTracingSettings::scalingMultisampling = true

If enabled and scaling is enabled, will sample 9 texels from the scaled indirect lighting image in order to smooth artifacts that can be created by upsampling.

◆ specularBounceStrength

double CeresEngine::VoxelConeTracingSettings::specularBounceStrength = 1.0

A multiplier to the applied to the bounced light strength.

◆ specularMaxTracingDistance

double CeresEngine::VoxelConeTracingSettings::specularMaxTracingDistance = 1.0

The maximum voxel distance to trace a cone.

1.0 will trace the entire voxel volume.

◆ specularSamplingFactor

double CeresEngine::VoxelConeTracingSettings::specularSamplingFactor = 0.9

The factor to increase the cone radius each iteration of the specular component.

◆ traceAmbientOcclusion

bool CeresEngine::VoxelConeTracingSettings::traceAmbientOcclusion = true

Disables ambient occlusion tracing.

Only effective if diffuse tracing is enabled.

◆ traceDiffuse

bool CeresEngine::VoxelConeTracingSettings::traceDiffuse = true

If set to true, will trace 6 cones that compound the diffuse global illumination component.

◆ traceNormalOrientedDiffuseCone

bool CeresEngine::VoxelConeTracingSettings::traceNormalOrientedDiffuseCone = true

If set to true will trace diffuse cones around the normal vector.

While this increases the visual quality of the diffuse GI, the memory access patter thrashes the GPU cache and can cause terrible issues with memory access.

◆ traceSimplifiedDiffuseCone

bool CeresEngine::VoxelConeTracingSettings::traceSimplifiedDiffuseCone = false

Traces a unique and simplified diffuse cone.

This cone will be very wide and very rough, but will significantly improve the speed at which the cone tracing is computed.

◆ traceSpecular

bool CeresEngine::VoxelConeTracingSettings::traceSpecular = true

Whether the specular cone should be traced.

If disabled, metals might look dark and fake.

◆ useShadowMapIfAvailable

bool CeresEngine::VoxelConeTracingSettings::useShadowMapIfAvailable = true

Allows the algorithm to reuse a shadow map if available.

Using a shadow map can increase performance and quality of the global illumination.

◆ volumeDimension

UInt32 CeresEngine::VoxelConeTracingSettings::volumeDimension = 256

The resolution used by the voxel image.

Higher values yield a much better global illumination, but cost increases cubically.

◆ voxelUpdateChunkSize

UInt32 CeresEngine::VoxelConeTracingSettings::voxelUpdateChunkSize = 8

To avoid recomputing the voxel frequently, the scene is only revoxelized once the camera has moved several voxels.

The number of voxels the camera center must move before triggering a revoxelization is determined by voxelUpdateChunkSize.

Frequently revoxelization, besides lowering performance, can also cause some flickering artifacts.


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