r.Water.WaterInfo.ShowSceneProxies
r.Water.WaterInfo.ShowSceneProxies
#Overview
name: r.Water.WaterInfo.ShowSceneProxies
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When enabled, shows the water scene proxies in the main viewport. Useful for debugging only.\n0: Disabled\n1: Only show water info mesh\n2: Only show water info dilated mesh\n3: Show both water info meshes
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Water.WaterInfo.ShowSceneProxies is to control the visibility of water scene proxies in the main viewport for debugging purposes. This setting variable is part of the Unreal Engine’s water rendering system.
The Unreal Engine subsystem that relies on this setting variable is the Water plugin, specifically the experimental Water module. This can be inferred from the file path of the source code: Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterBodyInfoMeshComponent.cpp.
The value of this variable is set through a console command. It’s defined as a TAutoConsoleVariable with a default value of 0, which means it’s disabled by default.
This variable interacts with another variable named CVarShowWaterInfoSceneProxies. They share the same value and are essentially the same variable, with CVarShowWaterInfoSceneProxies being the C++ representation of the console variable.
Developers must be aware that this variable is intended for debugging purposes only. It should not be used in production builds or for gameplay features. The variable has four possible values: 0: Disabled (default) 1: Only show water info mesh 2: Only show water info dilated mesh 3: Show both water info meshes
Best practices when using this variable include:
- Only enable it during development and debugging phases.
- Be aware that enabling this variable may impact performance, especially when showing both water info meshes.
- Use it in conjunction with other water debugging tools for a comprehensive understanding of the water system’s behavior.
- Remember to disable it before creating a release build.
Regarding the associated variable CVarShowWaterInfoSceneProxies:
The purpose of CVarShowWaterInfoSceneProxies is to provide a C++ interface to the r.Water.WaterInfo.ShowSceneProxies console variable. It allows C++ code to read and react to the current setting of the debug visualization.
This variable is used within the Water plugin’s runtime module, specifically in the WaterBodyInfoMeshComponent.cpp file.
The value of this variable is set indirectly through the console command r.Water.WaterInfo.ShowSceneProxies. In C++ code, its value can be accessed using the GetValueOnAnyThread() method.
CVarShowWaterInfoSceneProxies interacts directly with the r.Water.WaterInfo.ShowSceneProxies console variable, as they represent the same setting.
Developers should be aware that this variable is used to control the visibility of water scene proxies in C++ code. It’s used in conditional statements to determine whether and which water info meshes should be displayed.
Best practices for using CVarShowWaterInfoSceneProxies include:
- Use GetValueOnAnyThread() to read its value in performance-critical code paths.
- Be cautious about frequently checking this value in tight loops, as it could impact performance.
- Consider caching the value if it’s used multiple times in a single frame or update cycle.
- Remember that changes to this value through the console will affect the behavior of the code that uses CVarShowWaterInfoSceneProxies.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterBodyInfoMeshComponent.cpp:17
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarShowWaterInfoSceneProxies(
TEXT("r.Water.WaterInfo.ShowSceneProxies"),
0,
TEXT("When enabled, shows the water scene proxies in the main viewport. Useful for debugging only.\n")
TEXT("0: Disabled\n")
TEXT("1: Only show water info mesh\n")
TEXT("2: Only show water info dilated mesh\n")
TEXT("3: Show both water info meshes"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarShowWaterInfoSceneProxies
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterBodyInfoMeshComponent.cpp:16
Scope: file
Source code excerpt:
}
static TAutoConsoleVariable<int32> CVarShowWaterInfoSceneProxies(
TEXT("r.Water.WaterInfo.ShowSceneProxies"),
0,
TEXT("When enabled, shows the water scene proxies in the main viewport. Useful for debugging only.\n")
TEXT("0: Disabled\n")
TEXT("1: Only show water info mesh\n")
TEXT("2: Only show water info dilated mesh\n")
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterBodyInfoMeshComponent.cpp:83
Scope (from outer to inner):
file
function static bool ShouldShowOutsideWaterInfoPass
Source code excerpt:
return false;
#else
const int32 ShowWaterInfoSceneProxiesValue = CVarShowWaterInfoSceneProxies.GetValueOnAnyThread();
return (ShowWaterInfoSceneProxiesValue == 1 && !bIsDilatedMesh) || (ShowWaterInfoSceneProxiesValue == 2 && bIsDilatedMesh) || (ShowWaterInfoSceneProxiesValue > 2);
#endif
}
void FWaterBodyInfoMeshSceneProxy::SetEnabled(bool bInEnabled)
{