r.HeterogeneousVolumes.MaxStepCount
r.HeterogeneousVolumes.MaxStepCount
#Overview
name: r.HeterogeneousVolumes.MaxStepCount
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The maximum ray-marching step count (Default = 512)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.MaxStepCount is to control the maximum number of ray-marching steps in the heterogeneous volumes rendering system. This setting is crucial for balancing rendering quality and performance in volumetric effects.
This setting variable is primarily used by the Renderer module, specifically within the heterogeneous volumes rendering subsystem. It’s part of Unreal Engine’s advanced rendering capabilities, likely used for effects like volumetric fog or clouds.
The value of this variable is set as a console variable with a default value of 512. It can be adjusted at runtime through the console or configuration files.
The associated variable CVarHeterogeneousVolumesMaxStepCount directly interacts with r.HeterogeneousVolumes.MaxStepCount. They share the same value and purpose.
Developers must be aware that increasing this value can significantly impact performance, as it directly affects the number of computations performed during ray-marching. Conversely, setting it too low may result in visual artifacts or reduced quality in volumetric effects.
Best practices when using this variable include:
- Start with the default value and adjust incrementally based on visual quality and performance needs.
- Monitor performance impact when changing this value, especially on lower-end hardware.
- Consider exposing this as a user-adjustable setting for performance optimization on different hardware.
- Use in conjunction with other volumetric rendering settings for optimal results.
Regarding the associated variable CVarHeterogeneousVolumesMaxStepCount:
- It’s an internal representation of the console variable within the C++ code.
- It’s used to retrieve the current value of the setting in the rendering code, specifically in the GetMaxStepCount() function within the HeterogeneousVolumes namespace.
- This variable allows for thread-safe access to the setting value on the render thread.
- Developers should use this variable when they need to access the max step count value in C++ code, particularly within 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/HeterogeneousVolumes.cpp:79
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesMaxStepCount(
TEXT("r.HeterogeneousVolumes.MaxStepCount"),
512,
TEXT("The maximum ray-marching step count (Default = 512)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarHeterogeneousVolumesMaxTraceDistance(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesMaxStepCount
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:78
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesMaxStepCount(
TEXT("r.HeterogeneousVolumes.MaxStepCount"),
512,
TEXT("The maximum ray-marching step count (Default = 512)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:409
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function float GetMaxStepCount
Source code excerpt:
float GetMaxStepCount()
{
return CVarHeterogeneousVolumesMaxStepCount.GetValueOnRenderThread();
}
int32 GetMipLevel()
{
return CVarHeterogeneousVolumesPreshadingMipLevel.GetValueOnRenderThread();
}