r.HeterogeneousVolumes.Shadows.UseAVSMCompression
r.HeterogeneousVolumes.Shadows.UseAVSMCompression
#Overview
name: r.HeterogeneousVolumes.Shadows.UseAVSMCompression
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables AVSM compression (Default = 1)\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.Shadows.UseAVSMCompression is to enable or disable AVSM (Adaptive Volumetric Shadow Maps) compression for heterogeneous volumes in the rendering system.
This setting variable is primarily used by the Renderer module, specifically in the Heterogeneous Volumes subsystem. It affects the shadow rendering pipeline for volumetric effects.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1 (enabled) and can be changed at runtime.
The associated variable CVarHeterogeneousVolumesShadowUseAVSMCompression directly interacts with this setting. It’s a TAutoConsoleVariable
Developers must be aware that this setting affects the quality and performance of shadow rendering for heterogeneous volumes. Enabling AVSM compression (default) can improve performance at the cost of some shadow quality.
Best practices when using this variable include:
- Keep it enabled (1) for better performance unless shadow quality issues are observed.
- Test thoroughly with both enabled and disabled states to ensure your game’s visuals are not negatively impacted.
- Consider exposing this setting to end-users if shadow quality vs. performance is a critical aspect of your game.
Regarding the associated variable CVarHeterogeneousVolumesShadowUseAVSMCompression:
- It’s the actual implementation of the console variable in the C++ code.
- It’s used to retrieve the current value of the setting through the GetValueOnRenderThread() method.
- The UseAVSMCompression() function in the HeterogeneousVolumes namespace uses this variable to determine if AVSM compression should be applied.
- Developers should use this variable when they need to check the current state of AVSM compression in their C++ code, particularly within 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/HeterogeneousVolumesVoxelGridPipeline.cpp:239
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesShadowUseAVSMCompression(
TEXT("r.HeterogeneousVolumes.Shadows.UseAVSMCompression"),
1,
TEXT("Enables AVSM compression (Default = 1)\n"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesShadowDebugTweak(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesShadowUseAVSMCompression
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:238
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesShadowUseAVSMCompression(
TEXT("r.HeterogeneousVolumes.Shadows.UseAVSMCompression"),
1,
TEXT("Enables AVSM compression (Default = 1)\n"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:438
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function bool UseAVSMCompression
Source code excerpt:
bool UseAVSMCompression()
{
return CVarHeterogeneousVolumesShadowUseAVSMCompression.GetValueOnRenderThread() != 0;
}
float GetCameraDownsampleFactor()
{
return FMath::Max(CVarHeterogeneousVolumesShadowCameraDownsampleFactor.GetValueOnRenderThread(), 1);
}