r.DFFullResolution
r.DFFullResolution
#Overview
name: r.DFFullResolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
1 = full resolution distance field shadowing, 0 = half resolution with bilateral upsample.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.DFFullResolution is to control the resolution of distance field shadowing in Unreal Engine’s rendering system. It determines whether the engine uses full resolution distance field shadowing or half resolution with bilateral upsample.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically in the distance field shadowing subsystem. It directly affects the quality and performance of shadows rendered using distance fields.
The value of this variable is set through the console variable system in Unreal Engine. It’s initialized to 0 by default, meaning half resolution with bilateral upsample is used.
The r.DFFullResolution variable interacts with the associated variable GFullResolutionDFShadowing. They share the same value, with GFullResolutionDFShadowing being the internal C++ representation of the console variable.
Developers must be aware that changing this variable will impact both the visual quality of shadows and the rendering performance. Setting it to 1 will result in higher quality shadows but may come at a performance cost, especially on lower-end hardware.
Best practices when using this variable include:
- Testing the impact on both visual quality and performance when changing the value.
- Considering the target hardware when deciding on the appropriate setting.
- Using it in conjunction with other shadow and rendering settings for optimal results.
Regarding the associated variable GFullResolutionDFShadowing:
The purpose of GFullResolutionDFShadowing is to serve as the internal C++ representation of the r.DFFullResolution console variable. It’s used directly in the C++ code to determine the shadow resolution.
This variable is used in the Renderer module, specifically in the distance field shadowing calculations.
The value of GFullResolutionDFShadowing is set by the console variable system when r.DFFullResolution is modified.
GFullResolutionDFShadowing interacts with other rendering variables and functions, such as GAODownsampleFactor in the GetDFShadowDownsampleFactor function.
Developers should be aware that modifying GFullResolutionDFShadowing directly in C++ code is not recommended. Instead, they should use the console variable r.DFFullResolution to ensure proper synchronization.
Best practices for GFullResolutionDFShadowing include:
- Accessing its value rather than modifying it directly in C++ code.
- Using it in conditional statements to adjust rendering behavior based on the chosen shadow resolution.
- Considering its impact on related rendering calculations and optimizations.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DistanceFieldShadowing.cpp:51
Scope: file
Source code excerpt:
int32 GFullResolutionDFShadowing = 0;
FAutoConsoleVariableRef CVarFullResolutionDFShadowing(
TEXT("r.DFFullResolution"),
GFullResolutionDFShadowing,
TEXT("1 = full resolution distance field shadowing, 0 = half resolution with bilateral upsample."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GShadowScatterTileCulling = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GFullResolutionDFShadowing
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DistanceFieldShadowing.cpp:49
Scope: file
Source code excerpt:
);
int32 GFullResolutionDFShadowing = 0;
FAutoConsoleVariableRef CVarFullResolutionDFShadowing(
TEXT("r.DFFullResolution"),
GFullResolutionDFShadowing,
TEXT("1 = full resolution distance field shadowing, 0 = half resolution with bilateral upsample."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GShadowScatterTileCulling = 1;
FAutoConsoleVariableRef CVarShadowScatterTileCulling(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DistanceFieldShadowing.cpp:138
Scope (from outer to inner):
file
function int32 GetDFShadowDownsampleFactor
Source code excerpt:
int32 GetDFShadowDownsampleFactor()
{
return GFullResolutionDFShadowing ? 1 : GAODownsampleFactor;
}
FIntPoint GetBufferSizeForDFShadows(const FViewInfo& View)
{
return FIntPoint::DivideAndRoundDown(View.GetSceneTexturesConfig().Extent, GetDFShadowDownsampleFactor());
}