r.Water.SingleLayer.TiledComposite
r.Water.SingleLayer.TiledComposite
#Overview
name: r.Water.SingleLayer.TiledComposite
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable tiled optimization of the single layer water reflection rendering system.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Water.SingleLayer.TiledComposite is to enable or disable tiled optimization for the single layer water reflection rendering system in Unreal Engine 5. This setting is part of the rendering system, specifically for water rendering optimization.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the single layer water rendering system. This can be seen from the file location where the variable is defined and used: ‘Engine/Source/Runtime/Renderer/Private/SingleLayerWaterRendering.cpp’.
The value of this variable is set as a console variable with a default value of 1 (enabled). It can be changed at runtime through the console or configuration files.
This variable interacts with other parts of the single layer water rendering system. It’s used in conjunction with the UseSingleLayerWaterIndirectDraw function to determine whether to use tiled rendering optimization.
Developers must be aware that this variable affects the performance and potentially the visual quality of water rendering. Enabling it (value 1) activates the tiled optimization, which can improve performance, especially for large water bodies.
Best practices when using this variable include:
- Testing the performance impact with and without tiled optimization for your specific use case.
- Considering the trade-off between performance and potential visual artifacts that might occur with tiled rendering.
- Being cautious when changing this value at runtime, as it could cause sudden changes in rendering performance or quality.
Regarding the associated variable CVarWaterSingleLayerTiledComposite:
The purpose of CVarWaterSingleLayerTiledComposite is to provide a programmatic way to access and modify the r.Water.SingleLayer.TiledComposite setting within the C++ code.
This variable is used within the Renderer module to check the current state of the tiled optimization setting and make rendering decisions based on it.
The value of this variable is set when the r.Water.SingleLayer.TiledComposite console variable is initialized or changed.
CVarWaterSingleLayerTiledComposite interacts directly with the r.Water.SingleLayer.TiledComposite console variable, effectively serving as its in-code representation.
Developers should be aware that this variable is used in rendering logic decisions, so modifying it could have immediate effects on the water rendering pipeline.
Best practices for using CVarWaterSingleLayerTiledComposite include:
- Using GetValueOnRenderThread() to safely access its value in render thread operations.
- Avoiding direct modification of this variable; instead, change the console variable if needed.
- Being mindful of the performance implications when checking this variable in frequently called functions.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SingleLayerWaterRendering.cpp:56
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarWaterSingleLayerTiledComposite(
TEXT("r.Water.SingleLayer.TiledComposite"), 1,
TEXT("Enable tiled optimization of the single layer water reflection rendering system."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarWaterSingleLayerSSRTAA(
TEXT("r.Water.SingleLayer.SSRTAA"), 1,
TEXT("Enable SSR denoising using TAA for the single layer water rendering system."),
#Associated Variable and Callsites
This variable is associated with another variable named CVarWaterSingleLayerTiledComposite
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SingleLayerWaterRendering.cpp:55
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarWaterSingleLayerTiledComposite(
TEXT("r.Water.SingleLayer.TiledComposite"), 1,
TEXT("Enable tiled optimization of the single layer water reflection rendering system."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarWaterSingleLayerSSRTAA(
TEXT("r.Water.SingleLayer.SSRTAA"), 1,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SingleLayerWaterRendering.cpp:462
Scope: file
Source code excerpt:
{
FSingleLayerWaterTileClassification Result;
const bool bRunTiled = UseSingleLayerWaterIndirectDraw(View.GetShaderPlatform()) && CVarWaterSingleLayerTiledComposite.GetValueOnRenderThread();
if (bRunTiled)
{
FIntPoint ViewRes(View.ViewRect.Width(), View.ViewRect.Height());
Result.TiledViewRes = FIntPoint::DivideAndRoundUp(ViewRes, SLW_TILE_SIZE_XY);
Result.TiledReflection.DrawIndirectParametersBuffer = GraphBuilder.CreateBuffer(FRDGBufferDesc::CreateIndirectDesc<FRHIDrawIndirectParameters>(), TEXT("SLW.WaterIndirectDrawParameters"));
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SingleLayerWaterRendering.cpp:671
Scope (from outer to inner):
file
function FSingleLayerWaterPrePassResult* FDeferredShadingSceneRenderer::RenderSingleLayerWaterDepthPrepass
Source code excerpt:
{
FViewInfo& View = Views[ViewIndex];
if (UseSingleLayerWaterIndirectDraw(View.GetShaderPlatform()) && CVarWaterSingleLayerTiledComposite.GetValueOnRenderThread())
{
Result->ViewTileClassification[ViewIndex] = ClassifyTiles(GraphBuilder, View, SceneTextures, OutDepthPrepassTexture.Resolve);
}
}
return Result;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SingleLayerWaterRendering.cpp:875
Scope: file
Source code excerpt:
};
const bool bRunTiled = UseSingleLayerWaterIndirectDraw(View.GetShaderPlatform()) && CVarWaterSingleLayerTiledComposite.GetValueOnRenderThread();
FSingleLayerWaterTileClassification SingleLayerWaterTileClassification;
if (bRunTiled)
{
if (SingleLayerWaterPrePassResult)
{