r.Water.WaterMesh.LocalTessellation.Freeze
r.Water.WaterMesh.LocalTessellation.Freeze
#Overview
name: r.Water.WaterMesh.LocalTessellation.Freeze
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Pauses the local tessellation updates to allow the view to move forward without moving the sliding window.\nCan be used to view things outside the sliding window more closely.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Water.WaterMesh.LocalTessellation.Freeze is to control the behavior of local tessellation updates in the water rendering system of Unreal Engine 5. Specifically, it allows pausing the local tessellation updates, which enables the view to move forward without moving the sliding window. This can be useful for viewing areas outside the normal sliding window more closely.
This setting variable is primarily used in the Water plugin, which is part of the experimental features in Unreal Engine 5. Based on the callsites, it’s clear that the Water module’s runtime implementation relies on this variable, particularly in the WaterViewExtension component.
The value of this variable is set using a console variable (CVar) system. It’s defined as a boolean value, with a default setting of false. This means that by default, local tessellation updates are not frozen.
The associated variable CVarLocalTessellationFreeze directly interacts with r.Water.WaterMesh.LocalTessellation.Freeze. They share the same value and purpose, with CVarLocalTessellationFreeze being the C++ representation of the console variable.
Developers must be aware that enabling this variable will pause local tessellation updates, which could affect the visual quality and performance of water rendering. It’s important to use this feature judiciously, as it’s primarily intended for debugging or specific viewing scenarios.
Best practices when using this variable include:
- Only enable it when necessary for debugging or specific viewing requirements.
- Remember to disable it after use to ensure normal water rendering behavior.
- Be aware that enabling this feature may impact performance or visual quality in unexpected ways.
- Use in conjunction with other water rendering settings for optimal results.
Regarding the associated variable CVarLocalTessellationFreeze:
The purpose of CVarLocalTessellationFreeze is to provide a programmatic interface to the r.Water.WaterMesh.LocalTessellation.Freeze console variable within the C++ code of the Water plugin.
This variable is used within the Water plugin’s runtime module, specifically in the WaterViewExtension component. It’s primarily used to control the behavior of the SetupView function in the FWaterViewExtension class.
The value of CVarLocalTessellationFreeze is set when the console variable r.Water.WaterMesh.LocalTessellation.Freeze is modified. It’s defined as a TAutoConsoleVariable
CVarLocalTessellationFreeze directly interacts with the r.Water.WaterMesh.LocalTessellation.Freeze console variable, effectively serving as its in-code representation.
Developers should be aware that this variable is checked on the game thread (GetValueOnGameThread()), which means changes to this variable will only take effect on the next frame.
Best practices for using CVarLocalTessellationFreeze include:
- Use it for conditional logic in water rendering code where pausing local tessellation updates is necessary.
- Be mindful of potential performance implications when frequently checking its value.
- Consider caching its value if used in performance-critical sections of code.
- Remember that changes to this variable will only take effect on the next frame due to it being checked on the game thread.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterViewExtension.cpp:12
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarLocalTessellationFreeze(
TEXT("r.Water.WaterMesh.LocalTessellation.Freeze"),
false,
TEXT("Pauses the local tessellation updates to allow the view to move forward without moving the sliding window.\n")
TEXT("Can be used to view things outside the sliding window more closely."),
ECVF_Default);
static TAutoConsoleVariable<float> CVarLocalTessellationUpdateMargin(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLocalTessellationFreeze
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterViewExtension.cpp:11
Scope: file
Source code excerpt:
#include "Containers/DynamicRHIResourceArray.h"
static TAutoConsoleVariable<bool> CVarLocalTessellationFreeze(
TEXT("r.Water.WaterMesh.LocalTessellation.Freeze"),
false,
TEXT("Pauses the local tessellation updates to allow the view to move forward without moving the sliding window.\n")
TEXT("Can be used to view things outside the sliding window more closely."),
ECVF_Default);
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/WaterViewExtension.cpp:292
Scope (from outer to inner):
file
function void FWaterViewExtension::SetupView
Source code excerpt:
void FWaterViewExtension::SetupView(FSceneViewFamily& InViewFamily, FSceneView& InView)
{
if (CVarLocalTessellationFreeze.GetValueOnGameThread())
{
return;
}
const FVector ViewLocation = InView.ViewLocation;