r.SplineMesh.SceneTextures.ForceUpdate
r.SplineMesh.SceneTextures.ForceUpdate
#Overview
name: r.SplineMesh.SceneTextures.ForceUpdate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When true, will force an update of the whole spline mesh scene texture each frame (for debugging).
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SplineMesh.SceneTextures.ForceUpdate is to force an update of the entire spline mesh scene texture every frame, primarily for debugging purposes. This setting variable is part of the rendering system in Unreal Engine 5, specifically related to spline mesh rendering.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, as evidenced by its location in the SplineMeshSceneResources.cpp file within the Runtime/Renderer/Private directory.
The value of this variable is set through the console variable system. It’s initialized with a default value of 0, meaning the forced update is disabled by default.
This variable interacts with the associated variable CVarSplineMeshSceneTexturesForceUpdate, which is a TAutoConsoleVariable
Developers must be aware that enabling this variable (setting it to a non-zero value) will force the spline mesh scene texture to update every frame, which can have performance implications. This should only be used for debugging purposes and not in production builds.
Best practices when using this variable include:
- Only enable it when debugging spline mesh rendering issues.
- Disable it immediately after debugging to avoid unnecessary performance overhead.
- Use it in conjunction with other debugging tools to isolate and identify spline mesh rendering problems.
Regarding the associated variable CVarSplineMeshSceneTexturesForceUpdate:
The purpose of CVarSplineMeshSceneTexturesForceUpdate is to provide a programmatic way to control the r.SplineMesh.SceneTextures.ForceUpdate setting. It’s an auto console variable that allows the engine to interact with this setting through C++ code.
This variable is used within the FSplineMeshSceneUpdater::PostGPUSceneUpdate function to determine whether a full update of the spline mesh scene texture should be forced. The value is retrieved on the render thread using GetValueOnRenderThread().
Developers should be aware that this variable is marked as ECVF_RenderThreadSafe, meaning it’s safe to access from the render thread. However, changes to this variable should still be made with caution, as they can impact rendering performance.
Best practices for using CVarSplineMeshSceneTexturesForceUpdate include:
- Only modify it through the appropriate console variable interface or debugging tools.
- Be mindful of the performance impact when enabling it, especially in performance-critical scenarios.
- Use it in conjunction with other spline mesh debugging tools and variables for comprehensive debugging.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SplineMeshSceneResources.cpp:21
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarSplineMeshSceneTexturesForceUpdate(
TEXT("r.SplineMesh.SceneTextures.ForceUpdate"),
0,
TEXT("When true, will force an update of the whole spline mesh scene texture each frame (for debugging)."),
ECVF_RenderThreadSafe
);
int32 GSplineMeshSceneTexturesCaptureNextUpdate = 0;
#Associated Variable and Callsites
This variable is associated with another variable named CVarSplineMeshSceneTexturesForceUpdate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SplineMeshSceneResources.cpp:20
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarSplineMeshSceneTexturesForceUpdate(
TEXT("r.SplineMesh.SceneTextures.ForceUpdate"),
0,
TEXT("When true, will force an update of the whole spline mesh scene texture each frame (for debugging)."),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SplineMeshSceneResources.cpp:402
Scope (from outer to inner):
file
function void FSplineMeshSceneUpdater::PostGPUSceneUpdate
Source code excerpt:
// Check if we are forcing a full update because we have no cache or are debugging
const bool bForceUpdate = CVarSplineMeshSceneTexturesForceUpdate.GetValueOnRenderThread() != 0;
bool bFullUpdate = !SceneData->SavedPosTexture.IsValid() || bForceUpdate;
// Register or create the spline texture
FRDGTextureRef PosTexture = nullptr;
FRDGTextureRef RotTexture = nullptr;
if (NeededSize != CurSize)