r.HeterogeneousVolumes.Tessellation.Jitter
r.HeterogeneousVolumes.Tessellation.Jitter
#Overview
name: r.HeterogeneousVolumes.Tessellation.Jitter
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables jittering when tessellating the acceleration grids (Default = 1)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.Tessellation.Jitter is to enable or disable jittering when tessellating acceleration grids in the heterogeneous volumes rendering system.
This setting variable is primarily used in the Renderer module of Unreal Engine 5, specifically within the heterogeneous volumes rendering subsystem. It affects the tessellation process of acceleration grids, which are likely used for optimizing rendering performance of complex volumetric effects.
The value of this variable is set through the console variable system in Unreal Engine. It is defined as a TAutoConsoleVariable with a default value of 1 (enabled).
The associated variable CVarHeterogeneousVolumesTessellationJitter interacts directly with r.HeterogeneousVolumes.Tessellation.Jitter. This C++ variable is used to access the console variable’s value within the engine code.
Developers should be aware that:
- This setting is render thread safe, meaning it can be changed at runtime without causing threading issues.
- The jittering effect is binary - it’s either on (any non-zero value) or off (zero value).
- Changing this setting may affect the visual quality and performance of heterogeneous volume rendering.
Best practices when using this variable include:
- Testing the visual impact and performance with jittering both enabled and disabled to determine the optimal setting for your specific use case.
- Consider exposing this setting to end-users if the visual difference is significant and some users might prefer one option over the other.
- Monitor performance metrics when changing this setting, as it may impact rendering time.
Regarding the associated variable CVarHeterogeneousVolumesTessellationJitter:
- It is an int32 type TAutoConsoleVariable that directly corresponds to the r.HeterogeneousVolumes.Tessellation.Jitter console variable.
- Its value is accessed in the EnableJitter() function within the HeterogeneousVolumes namespace.
- The GetValueOnRenderThread() method is used to safely retrieve its value on the render thread.
- The function returns true if the value is non-zero, effectively treating it as a boolean.
Developers should use the EnableJitter() function when they need to check if jittering is enabled in render thread code, rather than accessing the console variable directly. This encapsulation allows for easier maintenance and potential future changes to how the jittering state is determined.
#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:100
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesTessellationJitter(
TEXT("r.HeterogeneousVolumes.Tessellation.Jitter"),
1,
TEXT("Enables jittering when tessellating the acceleration grids (Default = 1)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridResolution(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesTessellationJitter
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:99
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesTessellationJitter(
TEXT("r.HeterogeneousVolumes.Tessellation.Jitter"),
1,
TEXT("Enables jittering when tessellating the acceleration grids (Default = 1)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:378
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function bool EnableJitter
Source code excerpt:
bool EnableJitter()
{
return CVarHeterogeneousVolumesTessellationJitter.GetValueOnRenderThread() != 0;
}
int32 GetBottomLevelGridResolution()
{
return FMath::Clamp(CVarHeterogeneousVolumesBottomLevelGridResolution.GetValueOnRenderThread(), 1, 4);
}