r.SSR.TiledComposite.MinSpecular
r.SSR.TiledComposite.MinSpecular
#Overview
name: r.SSR.TiledComposite.MinSpecular
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Ignore pixels with very small specular contribution in case max roughness cannot filter them out
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SSR.TiledComposite.MinSpecular is to set a minimum threshold for specular contribution in Screen Space Reflections (SSR) tiled composite rendering. It is used to ignore pixels with very small specular contributions that may not be effectively filtered out by the maximum roughness setting.
This setting variable is primarily used in the rendering system, specifically in the Screen Space Reflection subsystem of Unreal Engine 5. It is part of the Renderer module, as evident from its location in the ScreenSpaceReflectionTiles.cpp file.
The value of this variable is set through the console variable system in Unreal Engine. It is defined as a TAutoConsoleVariable with a default value of 0.0f. Developers can modify this value at runtime using console commands or through project settings.
The associated variable CVarSSRTiledCompositeMinSpecular directly interacts with r.SSR.TiledComposite.MinSpecular. They share the same value and purpose.
Developers must be aware that this variable affects the performance and visual quality of screen space reflections. Setting it too high might result in missing reflections for materials with low specular values, while setting it too low might introduce noise or artifacts in the reflections.
Best practices when using this variable include:
- Fine-tuning the value based on the specific needs of the project and target hardware.
- Testing different values to find the optimal balance between performance and visual quality.
- Considering the interaction with other SSR-related settings, such as maximum roughness.
Regarding the associated variable CVarSSRTiledCompositeMinSpecular:
The purpose of CVarSSRTiledCompositeMinSpecular is to provide a programmatic interface to control the r.SSR.TiledComposite.MinSpecular setting within the C++ code of Unreal Engine.
This variable is used in the Renderer module, specifically in the Screen Space Reflection tiled composite system. It allows the engine to access and modify the minimum specular threshold for SSR calculations.
The value of CVarSSRTiledCompositeMinSpecular is set when the r.SSR.TiledComposite.MinSpecular console variable is modified. It can be accessed in C++ code using the GetValueOnRenderThread() method.
CVarSSRTiledCompositeMinSpecular directly interacts with the r.SSR.TiledComposite.MinSpecular console variable, serving as its C++ representation.
Developers should be aware that this variable is used in performance-critical render thread code and should be accessed carefully to avoid performance issues.
Best practices for using CVarSSRTiledCompositeMinSpecular include:
- Accessing its value only when necessary, preferably caching it if used frequently.
- Being mindful of the thread safety implications when accessing or modifying this variable.
- Using the GetValueOnRenderThread() method when accessing the value in render thread code.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceReflectionTiles.cpp:16
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarSSRTiledCompositeMinSpecular(
TEXT("r.SSR.TiledComposite.MinSpecular"), 0.0f,
TEXT("Ignore pixels with very small specular contribution in case max roughness cannot filter them out"),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarSSRTiledCompositeTwoSidedFoliage(
TEXT("r.SSR.TiledComposite.TwoSidedFoliage"), 0,
TEXT("0: diable SSR for foliage if tiling is enabled."),
#Associated Variable and Callsites
This variable is associated with another variable named CVarSSRTiledCompositeMinSpecular
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceReflectionTiles.cpp:15
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<float> CVarSSRTiledCompositeMinSpecular(
TEXT("r.SSR.TiledComposite.MinSpecular"), 0.0f,
TEXT("Ignore pixels with very small specular contribution in case max roughness cannot filter them out"),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarSSRTiledCompositeTwoSidedFoliage(
TEXT("r.SSR.TiledComposite.TwoSidedFoliage"), 0,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceReflectionTiles.cpp:180
Scope (from outer to inner):
file
function FScreenSpaceReflectionTileClassification ClassifySSRTiles
Source code excerpt:
PassParameters->TileMaskBufferOut = TileMaskBufferUAV;
PassParameters->MaxRoughness = GetScreenSpaceReflectionMaxRoughnessScale(View);
PassParameters->MinSpecular = FMath::Clamp(CVarSSRTiledCompositeMinSpecular.GetValueOnRenderThread(), -0.001f, 1.001f);
PassParameters->bEnableTwoSidedFoliage = CVarSSRTiledCompositeTwoSidedFoliage.GetValueOnRenderThread() != 0;
FComputeShaderUtils::AddPass(
GraphBuilder,
RDG_EVENT_NAME("SSR::TileCategorisationMarkTiles"),
ComputeShader,