r.VolumetricFog.VoxelizationSlicesPerGSPass
r.VolumetricFog.VoxelizationSlicesPerGSPass
#Overview
name: r.VolumetricFog.VoxelizationSlicesPerGSPass
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
How many depth slices to render in a single voxelization pass (max geometry shader expansion). Must recompile voxelization shaders to propagate changes.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VolumetricFog.VoxelizationSlicesPerGSPass is to control the number of depth slices rendered in a single voxelization pass for volumetric fog. This setting is specifically related to the rendering system, particularly the volumetric fog rendering pipeline.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically in the volumetric fog voxelization system. Based on the callsites, it’s clear that this variable is integral to the volumetric fog rendering process.
The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 8 and can be modified at runtime, though it’s marked as read-only (ECVF_ReadOnly), which means changes may not take effect immediately.
The associated variable GVolumetricFogVoxelizationSlicesPerGSPass directly interacts with r.VolumetricFog.VoxelizationSlicesPerGSPass. They share the same value and are used interchangeably in the code.
Developers must be aware of several important aspects when using this variable:
- Changes to this variable require recompilation of voxelization shaders to take effect.
- This setting affects the maximum geometry shader expansion, which can impact performance and visual quality.
- The value is only applicable on platforms that support geometry shaders.
Best practices when using this variable include:
- Carefully consider performance implications when adjusting the value, as higher values may increase rendering time.
- Test thoroughly on target platforms to ensure optimal balance between visual quality and performance.
- Be aware that changes require shader recompilation, so avoid frequent runtime modifications.
Regarding the associated variable GVolumetricFogVoxelizationSlicesPerGSPass:
The purpose of GVolumetricFogVoxelizationSlicesPerGSPass is to serve as the internal representation of the r.VolumetricFog.VoxelizationSlicesPerGSPass setting within the C++ code.
This variable is used directly in the Renderer module, specifically in the VolumetricFogVoxelization system. It’s used in the GetVoxelizationSlicesPerPass function to determine the number of slices per pass, considering whether the platform supports geometry shaders.
The value of this variable is set in tandem with r.VolumetricFog.VoxelizationSlicesPerGSPass through the console variable system.
As it’s directly tied to r.VolumetricFog.VoxelizationSlicesPerGSPass, the same considerations and best practices apply. Developers should be aware that this variable directly affects the voxelization process and should be handled with care, especially when considering cross-platform development and performance optimization.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricFogVoxelization.cpp:20
Scope: file
Source code excerpt:
int32 GVolumetricFogVoxelizationSlicesPerGSPass = 8;
FAutoConsoleVariableRef CVarVolumetricFogVoxelizationSlicesPerPass(
TEXT("r.VolumetricFog.VoxelizationSlicesPerGSPass"),
GVolumetricFogVoxelizationSlicesPerGSPass,
TEXT("How many depth slices to render in a single voxelization pass (max geometry shader expansion). Must recompile voxelization shaders to propagate changes."),
ECVF_ReadOnly
);
int32 GVolumetricFogVoxelizationShowOnlyPassIndex = -1;
#Associated Variable and Callsites
This variable is associated with another variable named GVolumetricFogVoxelizationSlicesPerGSPass
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricFogVoxelization.cpp:18
Scope: file
Source code excerpt:
#include "SceneUniformBuffer.h"
int32 GVolumetricFogVoxelizationSlicesPerGSPass = 8;
FAutoConsoleVariableRef CVarVolumetricFogVoxelizationSlicesPerPass(
TEXT("r.VolumetricFog.VoxelizationSlicesPerGSPass"),
GVolumetricFogVoxelizationSlicesPerGSPass,
TEXT("How many depth slices to render in a single voxelization pass (max geometry shader expansion). Must recompile voxelization shaders to propagate changes."),
ECVF_ReadOnly
);
int32 GVolumetricFogVoxelizationShowOnlyPassIndex = -1;
FAutoConsoleVariableRef CVarVolumetricFogVoxelizationShowOnlyPassIndex(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricFogVoxelization.cpp:36
Scope (from outer to inner):
file
function static int32 GetVoxelizationSlicesPerPass
Source code excerpt:
static FORCEINLINE int32 GetVoxelizationSlicesPerPass(EShaderPlatform Platform)
{
return RHISupportsGeometryShaders(Platform) ? GVolumetricFogVoxelizationSlicesPerGSPass : 1;
}
IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT(FVoxelizeVolumePassUniformParameters, "VoxelizeVolumePass", SceneTextures);
TRDGUniformBufferRef<FVoxelizeVolumePassUniformParameters> CreateVoxelizeVolumePassUniformBuffer(
FRDGBuilder& GraphBuilder,