r.Substrate.SpecularProfile.ForceUpdate
r.Substrate.SpecularProfile.ForceUpdate
#Overview
name: r.Substrate.SpecularProfile.ForceUpdate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0: Only update the specular profile as needed.\n1: Force to update the specular profile every frame for debugging.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Substrate.SpecularProfile.ForceUpdate is to control the update behavior of the specular profile in the rendering system. It is specifically designed for debugging purposes in the Unreal Engine’s rendering pipeline.
This setting variable is utilized by the rendering subsystem of Unreal Engine, particularly in the specular profile computation module. Based on the callsite details, it’s part of the Engine module, located in the SpecularProfile.cpp file.
The value of this variable is set through a console variable (CVarSpecularProfileForceUpdate) using the TAutoConsoleVariable template. It’s initialized with a default value of 0, meaning that by default, the specular profile is only updated as needed.
The associated variable CVarSpecularProfileForceUpdate directly interacts with r.Substrate.SpecularProfile.ForceUpdate. They share the same value and purpose.
Developers must be aware of several important aspects when using this variable:
- It’s only available in non-shipping and non-test builds (wrapped in #if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)).
- It’s marked as a cheat command (ECVF_Cheat) and is render thread safe (ECVF_RenderThreadSafe).
- Setting it to 1 will force the specular profile to update every frame, which could impact performance.
Best practices for using this variable include:
- Only enable it (set to 1) when debugging specular profile issues.
- Remember to disable it (set back to 0) after debugging to avoid unnecessary performance overhead.
- Be cautious when using it in multiplayer scenarios, as it’s marked as a cheat command.
Regarding the associated variable CVarSpecularProfileForceUpdate: Its purpose is to provide a programmatic way to access and modify the r.Substrate.SpecularProfile.ForceUpdate setting. It’s used internally by the engine to check whether forced updates are enabled. The ForceUpdateSpecularProfile function uses this variable to determine if the specular profile should be forcibly updated every frame. Developers should be aware that this variable is only accessible within the scope of the SpecularProfile.cpp file and is not directly modifiable from other parts of the codebase.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Rendering/SpecularProfile.cpp:28
Scope: file
Source code excerpt:
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
static TAutoConsoleVariable<int32> CVarSpecularProfileForceUpdate(
TEXT("r.Substrate.SpecularProfile.ForceUpdate"),
0,
TEXT("0: Only update the specular profile as needed.\n")
TEXT("1: Force to update the specular profile every frame for debugging.\n"),
ECVF_Cheat | ECVF_RenderThreadSafe);
#endif
#Associated Variable and Callsites
This variable is associated with another variable named CVarSpecularProfileForceUpdate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Rendering/SpecularProfile.cpp:27
Scope: file
Source code excerpt:
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
static TAutoConsoleVariable<int32> CVarSpecularProfileForceUpdate(
TEXT("r.Substrate.SpecularProfile.ForceUpdate"),
0,
TEXT("0: Only update the specular profile as needed.\n")
TEXT("1: Force to update the specular profile every frame for debugging.\n"),
ECVF_Cheat | ECVF_RenderThreadSafe);
#endif
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Rendering/SpecularProfile.cpp:38
Scope (from outer to inner):
file
function static bool ForceUpdateSpecularProfile
Source code excerpt:
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
return (CVarSpecularProfileForceUpdate.GetValueOnAnyThread() == 1);
#else
return false;
#endif
}
///////////////////////////////////////////////////////////////////////////////////////////////////