r.VolumetricCloud.StepSizeOnZeroConservativeDensity
r.VolumetricCloud.StepSizeOnZeroConservativeDensity
#Overview
name: r.VolumetricCloud.StepSizeOnZeroConservativeDensity
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Raymarch step size when a sample giving zero conservative density is encountered. If > 1, performance will likely improve but banding artifacts can show up if too large.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VolumetricCloud.StepSizeOnZeroConservativeDensity is to control the raymarch step size in volumetric cloud rendering when a sample with zero conservative density is encountered. This setting is part of the rendering system, specifically for volumetric cloud rendering optimization.
This setting variable is primarily used in the Renderer module of Unreal Engine, particularly in the volumetric cloud rendering subsystem. It’s referenced in the VolumetricCloudRendering.cpp file, which is responsible for handling the rendering of volumetric clouds.
The value of this variable is set using a console variable (CVarVolumetricCloudStepSizeOnZeroConservativeDensity). It’s initialized with a default value of 1 but can be changed at runtime through the console or configuration files.
This variable interacts with the VolumetricCloudParams structure, specifically setting the StepSizeOnZeroConservativeDensity parameter. It’s used in the SetupDefaultRenderVolumetricCloudGlobalParameters function to configure the volumetric cloud rendering parameters.
Developers must be aware that increasing this value can improve performance but may introduce banding artifacts if set too high. The value is clamped to a minimum of 1 to ensure valid behavior.
Best practices when using this variable include:
- Start with the default value of 1 and incrementally increase it while monitoring performance and visual quality.
- Be cautious when increasing the value, as it can introduce visual artifacts.
- Use this setting in conjunction with other volumetric cloud rendering settings for optimal results.
- Consider exposing this setting to artists or technical artists for fine-tuning in different scenarios.
Regarding the associated variable CVarVolumetricCloudStepSizeOnZeroConservativeDensity:
This is the actual console variable that stores the value for r.VolumetricCloud.StepSizeOnZeroConservativeDensity. It’s defined as a TAutoConsoleVariable
The purpose of this variable is the same as r.VolumetricCloud.StepSizeOnZeroConservativeDensity - to control the raymarch step size when encountering zero conservative density in volumetric cloud rendering.
This variable is used in the Renderer module, specifically in the volumetric cloud rendering system. It’s defined and used in the VolumetricCloudRendering.cpp file.
The value is set when the variable is initialized, but it can be changed at runtime through the console or configuration files.
This console variable directly interacts with the r.VolumetricCloud.StepSizeOnZeroConservativeDensity setting, as they represent the same value. It’s also used to set the StepSizeOnZeroConservativeDensity parameter in the VolumetricCloudParams structure.
Developers should be aware that this is a render thread safe and scalability-related console variable, as indicated by the ECVF_RenderThreadSafe and ECVF_Scalability flags.
Best practices for using this console variable include:
- Use it for debugging and performance tuning during development.
- Consider exposing it in the game’s graphics settings for advanced users.
- Document the performance and visual implications of changing this value for other team members.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:60
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarVolumetricCloudStepSizeOnZeroConservativeDensity(
TEXT("r.VolumetricCloud.StepSizeOnZeroConservativeDensity"), 1,
TEXT("Raymarch step size when a sample giving zero conservative density is encountered. If > 1, performance will likely improve but banding artifacts can show up if too large."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarVolumetricCloudHighQualityAerialPerspective(
TEXT("r.VolumetricCloud.HighQualityAerialPerspective"), 0,
TEXT("Enable/disable a second pass to trace the aerial perspective per pixel on clouds instead of using the aerial persepctive texture. Only usable when r.VolumetricCloud.EnableAerialPerspectiveSampling=1 and only needed for extra quality when r.VolumetricRenderTarget=1."),
#Associated Variable and Callsites
This variable is associated with another variable named CVarVolumetricCloudStepSizeOnZeroConservativeDensity
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:59
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarVolumetricCloudStepSizeOnZeroConservativeDensity(
TEXT("r.VolumetricCloud.StepSizeOnZeroConservativeDensity"), 1,
TEXT("Raymarch step size when a sample giving zero conservative density is encountered. If > 1, performance will likely improve but banding artifacts can show up if too large."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarVolumetricCloudHighQualityAerialPerspective(
TEXT("r.VolumetricCloud.HighQualityAerialPerspective"), 0,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:649
Scope (from outer to inner):
file
function void SetupDefaultRenderVolumetricCloudGlobalParameters
Source code excerpt:
VolumetricCloudParams.CloudDebugViewMode = GetVolumetricCloudDebugViewMode(ViewInfo.Family->EngineShowFlags);
VolumetricCloudParams.StepSizeOnZeroConservativeDensity = FMath::Max(CVarVolumetricCloudStepSizeOnZeroConservativeDensity.GetValueOnRenderThread(), 1);
VolumetricCloudParams.EmptySpaceSkippingSliceDepth = GetEmptySpaceSkippingSliceDepth();
VolumetricCloudParams.BlueNoise = GetBlueNoiseGlobalParameters();
VolumetricCloudParams.EnableHeightFog = ViewInfo.Family->Scene->HasAnyExponentialHeightFog() && ShouldRenderFog(*ViewInfo.Family);