r.HeterogeneousVolumes.Jitter
r.HeterogeneousVolumes.Jitter
#Overview
name: r.HeterogeneousVolumes.Jitter
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables jitter when ray marching (Default = 1)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.Jitter is to enable or disable jittering when ray marching in heterogeneous volumes rendering. This setting is part of the rendering system in Unreal Engine 5, specifically for the heterogeneous volumes feature.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the HeterogeneousVolumes component. This can be seen from the file path where the variable is defined: Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp.
The value of this variable is set as a console variable using TAutoConsoleVariable. It is initialized with a default value of 1, meaning jittering is enabled by default.
This variable interacts with its associated variable CVarHeterogeneousVolumesJitter. They share the same value and purpose. The CVarHeterogeneousVolumesJitter is used in the ShouldJitter() function to determine whether jittering should be applied during ray marching.
Developers must be aware that this variable affects the visual quality and performance of heterogeneous volume rendering. Enabling jittering can help reduce artifacts in the rendered volumes but may come at a slight performance cost.
Best practices when using this variable include:
- Keep it enabled (default value of 1) for better visual quality in most cases.
- Consider disabling it (set to 0) if performance is a critical issue and the visual artifacts are acceptable.
- Test the visual impact and performance with both settings to determine the best option for your specific use case.
Regarding the associated variable CVarHeterogeneousVolumesJitter:
The purpose of CVarHeterogeneousVolumesJitter is the same as r.HeterogeneousVolumes.Jitter - to control jittering in ray marching for heterogeneous volumes.
It is used within the Renderer module, specifically in the HeterogeneousVolumes namespace.
The value of this variable is set through the console variable system, with the same default value of 1 as r.HeterogeneousVolumes.Jitter.
This variable directly interacts with the ShouldJitter() function, which determines whether jittering should be applied during the rendering process.
Developers should be aware that this variable is accessed on the render thread, as indicated by the GetValueOnRenderThread() method used in the ShouldJitter() function.
Best practices for using CVarHeterogeneousVolumesJitter are the same as those for r.HeterogeneousVolumes.Jitter, as they represent the same setting. Developers should use this variable when they need to programmatically check or modify the jittering setting within C++ code, particularly on the render thread.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:72
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesJitter(
TEXT("r.HeterogeneousVolumes.Jitter"),
1,
TEXT("Enables jitter when ray marching (Default = 1)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesMaxStepCount(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesJitter
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:71
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesJitter(
TEXT("r.HeterogeneousVolumes.Jitter"),
1,
TEXT("Enables jitter when ray marching (Default = 1)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:472
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function bool ShouldJitter
Source code excerpt:
bool ShouldJitter()
{
return CVarHeterogeneousVolumesJitter.GetValueOnRenderThread() != 0;
}
bool UseHardwareRayTracing()
{
return IsRayTracingEnabled()
&& (CVarHeterogeneousVolumesHardwareRayTracing.GetValueOnRenderThread() != 0);