r.SSR.TiledComposite.TwoSidedFoliage
r.SSR.TiledComposite.TwoSidedFoliage
#Overview
name: r.SSR.TiledComposite.TwoSidedFoliage
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0: diable SSR for foliage if tiling is enabled.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SSR.TiledComposite.TwoSidedFoliage is to control whether Screen Space Reflections (SSR) are applied to two-sided foliage when tiled compositing is enabled in the rendering system.
This setting variable is primarily used by the rendering system, specifically in the Screen Space Reflection (SSR) subsystem of Unreal Engine 5. It is part of the tiled compositing feature for SSR, which is likely an optimization technique for rendering reflections.
The value of this variable is set through the console variable system in Unreal Engine. It is defined as a TAutoConsoleVariable with an initial value of 0, meaning SSR for foliage is disabled by default when tiling is enabled.
The associated C++ variable CVarSSRTiledCompositeTwoSidedFoliage directly interacts with this setting. It’s used to retrieve the current value of the setting in the render thread.
Developers should be aware that:
- This setting is render thread safe and scalable, as indicated by the ECVF_RenderThreadSafe and ECVF_Scalability flags.
- The setting is binary (0 or non-0), where 0 disables SSR for foliage when tiling is enabled.
- Changing this setting may impact performance and visual quality, especially in scenes with a lot of foliage.
Best practices when using this variable include:
- Test thoroughly with and without the setting enabled to understand its impact on your specific scene.
- Consider the performance implications, especially on lower-end hardware.
- Use in conjunction with other SSR and foliage-related settings for optimal results.
Regarding the associated variable CVarSSRTiledCompositeTwoSidedFoliage:
- Its purpose is to provide programmatic access to the r.SSR.TiledComposite.TwoSidedFoliage setting within the C++ code.
- It’s used in the ScreenSpaceReflectionTiles.cpp file, specifically in the FScreenSpaceReflectionTileClassification::ClassifySSRTiles function.
- The value is retrieved using GetValueOnRenderThread() method, ensuring thread-safe access.
- It’s used to set the bEnableTwoSidedFoliage parameter in the SSR tile classification pass.
Developers should be aware that changes to this variable will directly affect the SSR tile classification process. When modifying or using this variable, ensure that it’s accessed only on the render thread to maintain thread safety.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceReflectionTiles.cpp:21
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarSSRTiledCompositeTwoSidedFoliage(
TEXT("r.SSR.TiledComposite.TwoSidedFoliage"), 0,
TEXT("0: diable SSR for foliage if tiling is enabled."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<bool> CVarSSRTiledCompositeVisualize(
TEXT("r.SSR.TiledComposite.Visualize"), 0,
TEXT("1: Visualize the tiling region."),
#Associated Variable and Callsites
This variable is associated with another variable named CVarSSRTiledCompositeTwoSidedFoliage
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceReflectionTiles.cpp:20
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarSSRTiledCompositeTwoSidedFoliage(
TEXT("r.SSR.TiledComposite.TwoSidedFoliage"), 0,
TEXT("0: diable SSR for foliage if tiling is enabled."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<bool> CVarSSRTiledCompositeVisualize(
TEXT("r.SSR.TiledComposite.Visualize"), 0,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceReflectionTiles.cpp:181
Scope (from outer to inner):
file
function FScreenSpaceReflectionTileClassification ClassifySSRTiles
Source code excerpt:
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,
PassParameters,