r.Substrate.SheenQuality
r.Substrate.SheenQuality
#Overview
name: r.Substrate.SheenQuality
The value of this variable can be defined or overridden in .ini config files. 2
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Define Substrate sheen quality (1: Disney-based sheen, 2: Charlie-based sheen, ). r.Substrate.ShadingQuality=2 forces SheenQuality to 2. This variable is read-only.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Substrate.SheenQuality is to define the quality of sheen in the Substrate shading model within Unreal Engine 5’s rendering system. It controls the method used for calculating sheen effects on materials.
This setting variable is primarily used by the rendering subsystem of Unreal Engine 5, specifically within the Substrate shading model. Based on the callsites, it’s part of the RenderCore module.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1 and can be changed at runtime or through configuration files.
The r.Substrate.SheenQuality variable interacts with r.Substrate.ShadingQuality. If r.Substrate.ShadingQuality is set to 2, it forces r.Substrate.SheenQuality to also be 2.
Developers must be aware that this variable is read-only and render thread safe. It cannot be changed during gameplay, only at startup or through configuration files.
Best practices when using this variable include:
- Understanding the performance implications of each quality level.
- Considering the interaction with r.Substrate.ShadingQuality.
- Setting it appropriately based on the target hardware capabilities.
Regarding the associated variable CVarSubstrateSheenQuality:
The purpose of CVarSubstrateSheenQuality is to provide programmatic access to the r.Substrate.SheenQuality setting within the engine’s C++ code.
This variable is used internally by the engine to retrieve the current sheen quality setting. It’s part of the RenderCore module and is used in the Substrate namespace.
The value of CVarSubstrateSheenQuality is set automatically by the engine based on the r.Substrate.SheenQuality console variable.
CVarSubstrateSheenQuality interacts directly with r.Substrate.SheenQuality, essentially serving as its C++ representation.
Developers should be aware that this variable is intended for internal engine use. Direct manipulation of this variable should be avoided in favor of modifying r.Substrate.SheenQuality through proper channels.
Best practices for CVarSubstrateSheenQuality include:
- Using the provided GetSheenQuality() functions to access its value rather than directly accessing the variable.
- Being aware of its thread-safe nature when accessing it from different parts of the engine.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/Android/AndroidEngine.ini:99, section: [/Script/Engine.RendererSettings]
- INI Section:
/Script/Engine.RendererSettings
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/BaseIOSEngine.ini:17, section: [/Script/Engine.RendererSettings]
- INI Section:
/Script/Engine.RendererSettings
- Raw value:
2
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderUtils.cpp:1764
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarSubstrateSheenQuality(
TEXT("r.Substrate.SheenQuality"),
1,
TEXT("Define Substrate sheen quality (1: Disney-based sheen, 2: Charlie-based sheen, ). r.Substrate.ShadingQuality=2 forces SheenQuality to 2. This variable is read-only."),
ECVF_ReadOnly | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarSubstrateShadingQuality(
TEXT("r.Substrate.ShadingQuality"),
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderUtils.cpp:1969
Scope (from outer to inner):
file
namespace Substrate
function uint32 GetSheenQuality
Source code excerpt:
uint32 GetSheenQuality(EShaderPlatform InPlatform)
{
static FShaderPlatformCachedIniValue<int32> CVar(TEXT("r.Substrate.SheenQuality"));
return CVar.Get(InPlatform);
}
uint32 GetShadingQuality()
{
return CVarSubstrateShadingQuality.GetValueOnAnyThread();
#Associated Variable and Callsites
This variable is associated with another variable named CVarSubstrateSheenQuality
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderUtils.cpp:1763
Scope: file
Source code excerpt:
ECVF_ReadOnly | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarSubstrateSheenQuality(
TEXT("r.Substrate.SheenQuality"),
1,
TEXT("Define Substrate sheen quality (1: Disney-based sheen, 2: Charlie-based sheen, ). r.Substrate.ShadingQuality=2 forces SheenQuality to 2. This variable is read-only."),
ECVF_ReadOnly | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarSubstrateShadingQuality(
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RenderUtils.cpp:1964
Scope (from outer to inner):
file
namespace Substrate
function uint32 GetSheenQuality
Source code excerpt:
uint32 GetSheenQuality()
{
return CVarSubstrateSheenQuality.GetValueOnAnyThread();
}
uint32 GetSheenQuality(EShaderPlatform InPlatform)
{
static FShaderPlatformCachedIniValue<int32> CVar(TEXT("r.Substrate.SheenQuality"));
return CVar.Get(InPlatform);