r.SSS.Burley.Quality
r.SSS.Burley.Quality
#Overview
name: r.SSS.Burley.Quality
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0: Fallback mode. Burley falls back to run scattering in Separable with transmission in Burley for better performance. Separable parameters are automatically fitted.1: Automatic. The subsurface will only switch to separable in half resolution. (default)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SSS.Burley.Quality is to control the quality and performance trade-off of the Burley subsurface scattering (SSS) algorithm in Unreal Engine’s rendering system. This setting variable is specifically used to manage the rendering quality of subsurface scattering effects, which are crucial for realistic rendering of materials like skin, wax, or marble.
This setting variable is primarily used by the Renderer module of Unreal Engine, specifically within the post-processing subsystem that handles subsurface scattering effects.
The value of this variable is set through a console variable (CVarSSSBurleyQuality) with two possible options: 0: Fallback mode - Burley algorithm falls back to run scattering in Separable mode with transmission in Burley for better performance. Separable parameters are automatically fitted. 1: Automatic mode (default) - The subsurface will only switch to separable in half resolution.
The associated variable CVarSSSBurleyQuality directly interacts with r.SSS.Burley.Quality. They share the same value and purpose.
Developers must be aware that:
- This variable affects both rendering quality and performance.
- The fallback mode (0) prioritizes performance over quality.
- The automatic mode (1) attempts to balance quality and performance by adapting to the resolution.
Best practices when using this variable include:
- Use the default automatic mode (1) for most scenarios as it provides a good balance.
- Consider using the fallback mode (0) if performance is a critical issue and you can afford some quality loss in subsurface scattering effects.
- Test both modes in your specific use case to determine which provides the best balance of quality and performance for your project.
Regarding the associated variable CVarSSSBurleyQuality:
- It is an internal representation of the r.SSS.Burley.Quality setting.
- It’s used directly in the rendering code to determine the SSS algorithm’s behavior.
- The value is accessed on the render thread, indicating its usage in real-time rendering decisions.
- It interacts with other variables like bHalfRes to determine when to run in separable mode.
- Developers should not manipulate this variable directly but rather use the r.SSS.Burley.Quality console command to change its value.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessSubsurface.cpp:106
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarSSSBurleyQuality(
TEXT("r.SSS.Burley.Quality"),
1,
TEXT("0: Fallback mode. Burley falls back to run scattering in Separable with transmission in Burley for better performance. Separable parameters are automatically fitted.")
TEXT("1: Automatic. The subsurface will only switch to separable in half resolution. (default)"),
ECVF_RenderThreadSafe | ECVF_Scalability
);
#Associated Variable and Callsites
This variable is associated with another variable named CVarSSSBurleyQuality
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessSubsurface.cpp:105
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarSSSBurleyQuality(
TEXT("r.SSS.Burley.Quality"),
1,
TEXT("0: Fallback mode. Burley falls back to run scattering in Separable with transmission in Burley for better performance. Separable parameters are automatically fitted.")
TEXT("1: Automatic. The subsurface will only switch to separable in half resolution. (default)"),
ECVF_RenderThreadSafe | ECVF_Scalability
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessSubsurface.cpp:971
Scope (from outer to inner):
file
function void AddSubsurfaceViewPass
Source code excerpt:
//We run in separable mode under two conditions: 1) Run Burley fallback mode. 2) when the screen is in half resolution.
const bool bForceRunningInSeparable = CVarSSSBurleyQuality.GetValueOnRenderThread() == 0 || bHalfRes;
const bool bUseProfileIdCache = !bForceRunningInSeparable && IsProfileIdCacheEnabled();
const int32 MinGenerateMipsTileCount = FMath::Max(0, CVarSSSMipmapsMinTileCount.GetValueOnRenderThread());
/**