r.VRS.ReflectionEnvironmentSky
r.VRS.ReflectionEnvironmentSky
#Overview
name: r.VRS.ReflectionEnvironmentSky
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable VRS with ReflectionEnvironmentAndSky (PS) rendering.\n0: Disabled1: Full2: Conservative (default)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VRS.ReflectionEnvironmentSky is to control the application of Variable Rate Shading (VRS) to the Reflection Environment and Sky rendering pass in Unreal Engine 5. This setting is part of the rendering system, specifically the Variable Rate Shading feature.
This setting variable is primarily used within the Renderer module of Unreal Engine 5, particularly in the VariableRateShading subsystem. It’s referenced in the VariableRateShadingImageManager.cpp file, which suggests it’s a key part of managing VRS image generation and application.
The value of this variable is set through a console variable (CVar) system, allowing it to be changed at runtime. It’s initialized with a default value of 2, which corresponds to the “Conservative” setting.
The variable interacts closely with its associated variable CVarVRSReflectionEnvironmentSky, which is defined as a TAutoConsoleVariable
Developers should be aware that this variable has three possible settings: 0: Disabled (VRS is not applied to Reflection Environment and Sky rendering) 1: Full (VRS is fully applied) 2: Conservative (default, likely a balanced approach)
When using this variable, best practices include:
- Understanding the performance implications of each setting.
- Testing thoroughly when changing from the default conservative setting.
- Being aware that changes to this variable will affect the visual quality and performance of reflection and sky rendering.
- Considering the interaction with other VRS settings, as it’s part of a larger VRS system.
Regarding the associated variable CVarVRSReflectionEnvironmentSky: This is the C++ representation of the r.VRS.ReflectionEnvironmentSky console variable. It’s used internally by the engine to access and modify the VRS setting for Reflection Environment and Sky rendering. The variable is part of an array of CVars indexed by pass type, allowing the engine to efficiently apply VRS settings to different rendering passes. Developers working directly with the C++ code should use this variable name when referencing the setting, while those using console commands or config files should use r.VRS.ReflectionEnvironmentSky.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VariableRateShading/VariableRateShadingImageManager.cpp:132
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarVRSReflectionEnvironmentSky(
TEXT("r.VRS.ReflectionEnvironmentSky"),
2,
TEXT("Enable VRS with ReflectionEnvironmentAndSky (PS) rendering.\n")
TEXT("0: Disabled")
TEXT("1: Full")
TEXT("2: Conservative (default)"),
FConsoleVariableDelegate::CreateStatic(&CVarVRSImagePassTypeCallback),
#Associated Variable and Callsites
This variable is associated with another variable named CVarVRSReflectionEnvironmentSky
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VariableRateShading/VariableRateShadingImageManager.cpp:131
Scope: file
Source code excerpt:
FConsoleVariableDelegate::CreateStatic(&CVarVRSImagePassTypeCallback),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarVRSReflectionEnvironmentSky(
TEXT("r.VRS.ReflectionEnvironmentSky"),
2,
TEXT("Enable VRS with ReflectionEnvironmentAndSky (PS) rendering.\n")
TEXT("0: Disabled")
TEXT("1: Full")
TEXT("2: Conservative (default)"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VariableRateShading/VariableRateShadingImageManager.cpp:773
Scope (from outer to inner):
file
class class FDebugVariableRateShadingCS : public FGlobalShader
Source code excerpt:
CVarByPassType[EVRSPassType::SSAO] = &CVarVRS_SSAO;
CVarByPassType[EVRSPassType::SSR] = &CVarVRS_SSR;
CVarByPassType[EVRSPassType::ReflectionEnvironmentAndSky] = &CVarVRSReflectionEnvironmentSky;
CVarByPassType[EVRSPassType::LightFunctions] = &CVarVRSLightFunctions;
CVarByPassType[EVRSPassType::Decals] = &CVarVRSDecals;
}
} StaticData;
uint32 ImageTypeAsInt = StaticData.CVarByPassType[PassType]->GetValueOnRenderThread();