r.VolumetricCloud.ShadowMap.TemporalFiltering.LightRotationCutHistory
r.VolumetricCloud.ShadowMap.TemporalFiltering.LightRotationCutHistory
#Overview
name: r.VolumetricCloud.ShadowMap.TemporalFiltering.LightRotationCutHistory
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When the atmospheric light rotation in degree is larger than that, the temporal accumulation is restarted.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VolumetricCloud.ShadowMap.TemporalFiltering.LightRotationCutHistory is to control the threshold for restarting temporal accumulation in volumetric cloud shadow rendering based on atmospheric light rotation.
This setting variable is used in the rendering system, specifically in the volumetric cloud rendering subsystem of Unreal Engine 5. It is part of the temporal filtering mechanism for cloud shadows.
The value of this variable is set through a console variable (CVar) in the Unreal Engine’s rendering module. It is initialized with a default value of 10.0 degrees.
The associated variable CVarVolumetricCloudShadowTemporalFilteringLightRotationCutHistory directly interacts with it, as they share the same value and purpose.
Developers must be aware that this variable affects the performance and visual quality of volumetric cloud shadows. A lower value will result in more frequent restarts of temporal accumulation, potentially reducing ghosting artifacts but increasing computation cost. A higher value may improve performance but could lead to more noticeable artifacts when the light direction changes rapidly.
Best practices when using this variable include:
- Adjusting it based on the specific needs of the scene and the rate of light direction changes.
- Testing different values to find the optimal balance between visual quality and performance.
- Considering the target hardware capabilities when setting this value, as it can impact rendering performance.
Regarding the associated variable CVarVolumetricCloudShadowTemporalFilteringLightRotationCutHistory:
- It serves the same purpose as r.VolumetricCloud.ShadowMap.TemporalFiltering.LightRotationCutHistory.
- It is used in the volumetric cloud rendering system to determine when to restart temporal accumulation.
- The value is accessed in the rendering code using GetValueOnAnyThread() method.
- It is used to calculate a cosine angle threshold (LightRotationCutCosAngle) which is likely used to compare against the current light rotation.
- Developers should be aware that this variable is accessed from a lambda function in the rendering code, which suggests it might be used in a parallel or threaded context.
- Best practices include ensuring thread-safety when modifying this value and considering its impact on the entire volumetric cloud rendering pipeline.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:173
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarVolumetricCloudShadowTemporalFilteringLightRotationCutHistory(
TEXT("r.VolumetricCloud.ShadowMap.TemporalFiltering.LightRotationCutHistory"), 10.0f,
TEXT("When the atmospheric light rotation in degree is larger than that, the temporal accumulation is restarted."),
ECVF_RenderThreadSafe | ECVF_Scalability);
////////////////////////////////////////////////////////////////////////// Lighting component controls
static TAutoConsoleVariable<int32> CVarVolumetricCloudEnableAerialPerspectiveSampling(
#Associated Variable and Callsites
This variable is associated with another variable named CVarVolumetricCloudShadowTemporalFilteringLightRotationCutHistory
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:172
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<float> CVarVolumetricCloudShadowTemporalFilteringLightRotationCutHistory(
TEXT("r.VolumetricCloud.ShadowMap.TemporalFiltering.LightRotationCutHistory"), 10.0f,
TEXT("When the atmospheric light rotation in degree is larger than that, the temporal accumulation is restarted."),
ECVF_RenderThreadSafe | ECVF_Scalability);
////////////////////////////////////////////////////////////////////////// Lighting component controls
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:1926
Scope (from outer to inner):
file
lambda-function
Source code excerpt:
if(CloudShadowTemporalEnabled && ViewInfo.ViewState)
{
const float LightRotationCutCosAngle = FMath::Cos(FMath::DegreesToRadians(CVarVolumetricCloudShadowTemporalFilteringLightRotationCutHistory.GetValueOnAnyThread()));
FCloudShadowTemporalProcessCS::FPermutationDomain Permutation;
TShaderMapRef<FCloudShadowTemporalProcessCS> ComputeShader(GetGlobalShaderMap(ViewInfo.GetFeatureLevel()), Permutation);
FTemporalRenderTargetState& CloudShadowTemporalRT = ViewInfo.ViewState->VolumetricCloudShadowRenderTarget[LightIndex];
FRDGTextureRef CurrentShadowTexture = CloudShadowTemporalRT.GetOrCreateCurrentRT(GraphBuilder);