r.SSS.HalfRes
r.SSS.HalfRes
#Overview
name: r.SSS.HalfRes
The value of this variable can be defined or overridden in .ini config files. 5
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0: full quality (Combined Burley and Separable pass. Separable is not optimized, as reference)\n 1: parts of the algorithm runs in half resolution which is lower quality but faster (default, Separable only)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SSS.HalfRes is to control the quality and performance of the Subsurface Scattering (SSS) rendering in Unreal Engine 5. It determines whether the SSS algorithm runs in full resolution or half resolution.
This setting variable is primarily used by the rendering system, specifically the post-processing subsystem responsible for Subsurface Scattering effects. Based on the callsites, it’s clear that this variable is utilized within the PostProcessSubsurface module of the Renderer.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with a default value of 1, meaning half resolution is the default setting.
The associated variable CVarSSSHalfRes directly interacts with r.SSS.HalfRes. They share the same value and are used interchangeably in the code.
Developers must be aware that:
- Setting this variable to 0 will run the SSS algorithm in full quality, using both Combined Burley and Separable passes.
- Setting it to 1 (default) will run parts of the algorithm in half resolution, which is faster but lower quality.
- The half-resolution mode only uses the Separable pass and is not optimized for the Combined Burley pass.
Best practices when using this variable include:
- Use the default half-resolution mode (1) for better performance in most cases.
- Consider using full resolution (0) for close-up shots or when the highest quality SSS is required, keeping in mind the performance impact.
- Test both modes to find the best balance between quality and performance for your specific use case.
Regarding the associated variable CVarSSSHalfRes:
- It’s a console variable that directly corresponds to r.SSS.HalfRes.
- It’s used in the GetSubsurfaceModeForView function to determine whether to use half-resolution SSS.
- The same considerations and best practices apply to CVarSSSHalfRes as they do to r.SSS.HalfRes.
- Developers should be consistent in using either r.SSS.HalfRes or CVarSSSHalfRes throughout their code to avoid confusion.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:622, section: [EffectsQuality@0]
- INI Section:
EffectsQuality@0
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:649, section: [EffectsQuality@1]
- INI Section:
EffectsQuality@1
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:676, section: [EffectsQuality@2]
- INI Section:
EffectsQuality@2
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:703, section: [EffectsQuality@3]
- INI Section:
EffectsQuality@3
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:731, section: [EffectsQuality@Cine]
- INI Section:
EffectsQuality@Cine
- Raw value:
0
- Is Array:
False
#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:46
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarSSSHalfRes(
TEXT("r.SSS.HalfRes"),
1,
TEXT(" 0: full quality (Combined Burley and Separable pass. Separable is not optimized, as reference)\n")
TEXT(" 1: parts of the algorithm runs in half resolution which is lower quality but faster (default, Separable only)"),
ECVF_RenderThreadSafe | ECVF_Scalability);
TAutoConsoleVariable<int32> CVarSSSQuality(
#Associated Variable and Callsites
This variable is associated with another variable named CVarSSSHalfRes
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessSubsurface.cpp:45
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarSSSHalfRes(
TEXT("r.SSS.HalfRes"),
1,
TEXT(" 0: full quality (Combined Burley and Separable pass. Separable is not optimized, as reference)\n")
TEXT(" 1: parts of the algorithm runs in half resolution which is lower quality but faster (default, Separable only)"),
ECVF_RenderThreadSafe | ECVF_Scalability);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessSubsurface.cpp:215
Scope (from outer to inner):
file
function ESubsurfaceMode GetSubsurfaceModeForView
Source code excerpt:
if (bShowSubsurfaceScattering)
{
const bool bHalfRes = CVarSSSHalfRes.GetValueOnRenderThread() != 0;
if (bHalfRes)
{
return ESubsurfaceMode::HalfRes;
}
else
{