r.HeterogeneousVolumes.OrthoGrid
r.HeterogeneousVolumes.OrthoGrid
#Overview
name: r.HeterogeneousVolumes.OrthoGrid
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables an ortho voxel grid (Default = 1)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.OrthoGrid is to enable or disable an orthographic voxel grid for heterogeneous volumes rendering in Unreal Engine 5. This setting is primarily used in the rendering system, specifically for handling heterogeneous volumes.
-
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the HeterogeneousVolumes component within the rendering pipeline.
-
The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 1 (enabled) and can be changed at runtime.
-
This variable interacts with an associated variable named CVarHeterogeneousVolumesEnableOrthoVoxelGrid. They share the same value and purpose.
-
Developers must be aware that this variable is render thread safe (ECVF_RenderThreadSafe), meaning it can be safely accessed and modified from the render thread without causing race conditions.
-
Best practices when using this variable include:
- Use the provided EnableOrthoVoxelGrid() function to check if the orthographic voxel grid is enabled, rather than accessing the CVar directly.
- Be mindful of potential performance implications when enabling or disabling this feature, as it may affect rendering performance.
Regarding the associated variable CVarHeterogeneousVolumesEnableOrthoVoxelGrid:
-
Its purpose is identical to r.HeterogeneousVolumes.OrthoGrid, serving as the internal representation of the console variable.
-
It is used within the HeterogeneousVolumes namespace in the Renderer module.
-
The value is set through the console variable system and can be accessed using GetValueOnRenderThread() method.
-
This variable is directly used in the EnableOrthoVoxelGrid() function to determine if the orthographic voxel grid should be enabled.
-
Developers should be aware that this variable is of type int32, where a non-zero value indicates that the orthographic voxel grid is enabled.
-
Best practices include using the provided EnableOrthoVoxelGrid() function instead of directly accessing this variable, as it provides a cleaner interface and potential for future optimizations or changes in implementation.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:59
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesEnableOrthoVoxelGrid(
TEXT("r.HeterogeneousVolumes.OrthoGrid"),
1,
TEXT("Enables an ortho voxel grid (Default = 1)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarHeterogeneousVolumesOrthoGridShadingRate(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesEnableOrthoVoxelGrid
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:58
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesEnableOrthoVoxelGrid(
TEXT("r.HeterogeneousVolumes.OrthoGrid"),
1,
TEXT("Enables an ortho voxel grid (Default = 1)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:317
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function bool EnableOrthoVoxelGrid
Source code excerpt:
bool EnableOrthoVoxelGrid()
{
return CVarHeterogeneousVolumesEnableOrthoVoxelGrid.GetValueOnRenderThread() != 0;
}
float GetShadingRateForOrthoGrid()
{
return FMath::Max(CVarHeterogeneousVolumesOrthoGridShadingRate.GetValueOnRenderThread(), 0.1);
}