r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution
r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution
#Overview
name: r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Determines intra-tile bottom-level grid resolution (Default = 4)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution is to determine the intra-tile bottom-level grid resolution for heterogeneous volumes in Unreal Engine’s rendering system. This setting is specifically related to the tessellation of heterogeneous volumes, which are likely used in advanced rendering techniques for volumetric effects or complex 3D structures.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the HeterogeneousVolumes subsystem. Based on the code references, it’s part of the voxel grid pipeline for heterogeneous volumes.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 4, but can be changed at runtime through console commands or configuration files.
The associated variable CVarHeterogeneousVolumesBottomLevelGridResolution directly interacts with this setting. It’s an instance of TAutoConsoleVariable
Developers should be aware that:
- The value is clamped between 1 and 4 when used in the GetBottomLevelGridResolution() function.
- Changes to this value will affect the rendering performance and quality of heterogeneous volumes.
- This setting is marked as render thread safe (ECVF_RenderThreadSafe), meaning it can be safely accessed and modified from the render thread.
Best practices when using this variable include:
- Carefully consider the performance implications when adjusting this value, as higher resolutions may impact rendering performance.
- Test different values to find the optimal balance between visual quality and performance for your specific use case.
- Use the GetBottomLevelGridResolution() function to access the value, as it ensures the value is properly clamped.
Regarding the associated variable CVarHeterogeneousVolumesBottomLevelGridResolution:
- Its purpose is to provide a thread-safe way to store and access the bottom-level grid resolution setting.
- It’s used directly in the Renderer module, specifically in the HeterogeneousVolumes namespace.
- The value is set through the CVar system and can be modified at runtime.
- It interacts directly with the r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution console variable.
- Developers should be aware that this variable is accessed using GetValueOnRenderThread() to ensure thread safety.
- Best practices include using this variable through the provided GetBottomLevelGridResolution() function to ensure proper clamping and thread-safe access.
#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:107
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridResolution(
TEXT("r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution"),
4,
TEXT("Determines intra-tile bottom-level grid resolution (Default = 4)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridVoxelHashing(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesBottomLevelGridResolution
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:106
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridResolution(
TEXT("r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution"),
4,
TEXT("Determines intra-tile bottom-level grid resolution (Default = 4)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:383
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function int32 GetBottomLevelGridResolution
Source code excerpt:
int32 GetBottomLevelGridResolution()
{
return FMath::Clamp(CVarHeterogeneousVolumesBottomLevelGridResolution.GetValueOnRenderThread(), 1, 4);
}
int32 GetIndirectionGridResolution()
{
return FMath::Clamp(CVarHeterogeneousVolumesIndirectionGridResolution.GetValueOnRenderThread(), 1, 4);
}