r.Water.WaterInfo.UndergroundDilationDepthOffset
r.Water.WaterInfo.UndergroundDilationDepthOffset
#Overview
name: r.Water.WaterInfo.UndergroundDilationDepthOffset
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The minimum distance below the ground when we allow dilation to write on top of water
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Water.WaterInfo.UndergroundDilationDepthOffset is to control the minimum distance below the ground where dilation is allowed to write on top of water in the water rendering system of Unreal Engine 5.
This setting variable is primarily used in the water rendering subsystem of Unreal Engine 5. It is specifically utilized in the Water Info Texture rendering process, which is part of the broader water rendering system.
The value of this variable is set as a console variable with a default value of 64.0 units. It can be modified at runtime through the console or programmatically.
The variable interacts closely with another variable named CVarWaterInfoDilationOverwriteMinimumDistance, which is often used in conjunction to control the water info dilation process.
Developers must be aware that this variable affects the underground dilation depth offset in water rendering. Modifying this value will impact how water is rendered in relation to the ground, particularly in underground or near-ground scenarios.
Best practices for using this variable include:
- Carefully adjusting the value based on the specific needs of your water rendering requirements.
- Testing different values to find the optimal balance between visual quality and performance.
- Considering the interaction with other water rendering settings, particularly CVarWaterInfoDilationOverwriteMinimumDistance.
Regarding the associated variable CVarWaterInfoUndergroundDilationDepthOffset:
The purpose of CVarWaterInfoUndergroundDilationDepthOffset is identical to r.Water.WaterInfo.UndergroundDilationDepthOffset, as they share the same value and functionality.
This variable is used in the same water rendering subsystem of Unreal Engine 5, specifically in the Water Info Texture rendering process.
The value is set through the TAutoConsoleVariable declaration, with the same default value of 64.0 units.
It interacts directly with r.Water.WaterInfo.UndergroundDilationDepthOffset, as they are essentially the same variable accessed through different means.
Developers should be aware that modifying one of these variables will affect the other, as they share the same underlying value.
Best practices for using this variable are the same as those for r.Water.WaterInfo.UndergroundDilationDepthOffset, as they are functionally identical.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/WaterInfoTextureRendering.cpp:15
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarWaterInfoUndergroundDilationDepthOffset(
TEXT("r.Water.WaterInfo.UndergroundDilationDepthOffset"),
64.f,
TEXT("The minimum distance below the ground when we allow dilation to write on top of water"),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarWaterInfoDilationOverwriteMinimumDistance(
TEXT("r.Water.WaterInfo.DilationOverwriteMinimumDistance"),
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterInfoRendering.cpp:116
Scope (from outer to inner):
file
namespace UE::WaterInfo
function static void MergeWaterInfoAndDepth
Source code excerpt:
{
static auto* CVarDilationOverwriteMinimumDistance = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.Water.WaterInfo.DilationOverwriteMinimumDistance"));
static auto* CVarUndergroundDilationDepthOffset = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.Water.WaterInfo.UndergroundDilationDepthOffset"));
FWaterInfoMergePS::FParameters* PassParameters = GraphBuilder.AllocParameters<FWaterInfoMergePS::FParameters>();
PassParameters->View = View.ViewUniformBuffer;
PassParameters->RenderTargets[0] = FRenderTargetBinding(OutputTexture, ERenderTargetLoadAction::ENoAction);
PassParameters->SceneTextures = GetSceneTextureShaderParameters(View);
PassParameters->DepthTexture = DepthTexture;
#Associated Variable and Callsites
This variable is associated with another variable named CVarWaterInfoUndergroundDilationDepthOffset
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/WaterInfoTextureRendering.cpp:14
Scope: file
Source code excerpt:
DECLARE_GPU_DRAWCALL_STAT(WaterInfoTexture);
static TAutoConsoleVariable<float> CVarWaterInfoUndergroundDilationDepthOffset(
TEXT("r.Water.WaterInfo.UndergroundDilationDepthOffset"),
64.f,
TEXT("The minimum distance below the ground when we allow dilation to write on top of water"),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarWaterInfoDilationOverwriteMinimumDistance(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/WaterInfoTextureRendering.cpp:983
Scope (from outer to inner):
file
function void RenderWaterInfoTexture
Source code excerpt:
PassParameters->GroundZMin = RenderingParams.GroundZMin;
PassParameters->DilationOverwriteMinimumDistance = CVarWaterInfoDilationOverwriteMinimumDistance.GetValueOnRenderThread();
PassParameters->UndergroundDilationDepthOffset = CVarWaterInfoUndergroundDilationDepthOffset.GetValueOnRenderThread();
FPixelShaderUtils::AddFullscreenPass(
GraphBuilder,
ShaderMap,
RDG_EVENT_NAME("WaterInfoTextureMerge"),
PixelShader,