r.HeterogeneousVolumes.Tessellation.IndirectionGrid
r.HeterogeneousVolumes.Tessellation.IndirectionGrid
#Overview
name: r.HeterogeneousVolumes.Tessellation.IndirectionGrid
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables lazy allocation of bottom-level memory (Default = 1)\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.Tessellation.IndirectionGrid is to enable lazy allocation of bottom-level memory for heterogeneous volumes tessellation. This setting variable is part of the rendering system, specifically for the management of heterogeneous volumes.
This setting variable is primarily used in the Renderer module of Unreal Engine, as evidenced by its implementation in the HeterogeneousVolumesVoxelGridPipeline.cpp file. It’s part of the heterogeneous volumes rendering pipeline, which is likely a feature for efficiently rendering complex volumetric effects.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with a default value of 1 (enabled).
The associated variable CVarHeterogeneousVolumesIndirectionGrid directly interacts with this setting. It’s the C++ representation of the console variable and is used to access the current value of the setting.
Developers should be aware that this variable affects memory allocation strategies for heterogeneous volumes. When enabled (value != 0), it uses lazy allocation for bottom-level memory, which could impact performance and memory usage.
Best practices when using this variable include:
- Understanding the performance implications of enabling or disabling lazy allocation.
- Testing the impact on memory usage and rendering performance in different scenarios.
- Considering the trade-offs between memory efficiency and potential performance overhead of lazy allocation.
Regarding the associated variable CVarHeterogeneousVolumesIndirectionGrid:
The purpose of CVarHeterogeneousVolumesIndirectionGrid is to provide programmatic access to the r.HeterogeneousVolumes.Tessellation.IndirectionGrid setting within the C++ code.
This variable is used in the Renderer module, specifically in the HeterogeneousVolumes namespace. It’s crucial for the functioning of the heterogeneous volumes tessellation system.
The value of this variable is set by the console variable system and can be accessed using the GetValueOnRenderThread() method.
It directly interacts with the r.HeterogeneousVolumes.Tessellation.IndirectionGrid console variable, essentially serving as its C++ representation.
Developers should be aware that this variable is marked as ECVF_RenderThreadSafe, meaning it’s safe to access from the render thread.
Best practices for using this variable include:
- Always accessing its value using GetValueOnRenderThread() when in render thread code.
- Being cautious about changing its value during runtime, as it could affect ongoing rendering processes.
- Using it in conjunction with other heterogeneous volumes settings for a comprehensive control over the rendering pipeline.
#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:156
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesIndirectionGrid(
TEXT("r.HeterogeneousVolumes.Tessellation.IndirectionGrid"),
1,
TEXT("Enables lazy allocation of bottom-level memory (Default = 1)\n"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesIndirectionGridResolution(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesIndirectionGrid
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:155
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesIndirectionGrid(
TEXT("r.HeterogeneousVolumes.Tessellation.IndirectionGrid"),
1,
TEXT("Enables lazy allocation of bottom-level memory (Default = 1)\n"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:373
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function bool EnableIndirectionGrid
Source code excerpt:
bool EnableIndirectionGrid()
{
return CVarHeterogeneousVolumesIndirectionGrid.GetValueOnRenderThread() != 0;
}
bool EnableJitter()
{
return CVarHeterogeneousVolumesTessellationJitter.GetValueOnRenderThread() != 0;
}