r.SkinnedMesh.UpdateBoundsNotifyStreamingRadiusChangeRatio
r.SkinnedMesh.UpdateBoundsNotifyStreamingRadiusChangeRatio
#Overview
name: r.SkinnedMesh.UpdateBoundsNotifyStreamingRadiusChangeRatio
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Update the streaming manager when the radius changes by more than this ratio since the last update. A negative value will disable the update.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SkinnedMesh.UpdateBoundsNotifyStreamingRadiusChangeRatio
is to control when the streaming manager should be notified of changes in the bounding radius of skinned mesh components. This setting is part of the rendering and streaming system in Unreal Engine 5.
This setting variable is primarily used within the Engine module, specifically in the SkinnedMeshComponent subsystem. It’s referenced in the SkinnedMeshComponent.cpp
file, which handles the rendering and updating of skinned meshes.
The value of this variable is set using the Unreal Engine’s console variable system. It’s initialized with a default value of 0.1f and can be modified at runtime through console commands or configuration files.
The associated variable GUpdateBoundsNotifyStreamingRadiusChangeRatio
directly interacts with this console variable. They share the same value, with the console variable providing a way to modify the global variable at runtime.
Developers should be aware that this variable affects the frequency of streaming manager updates for skinned meshes. A lower value will result in more frequent updates, potentially improving accuracy but at the cost of performance. A negative value will disable the update completely.
Best practices when using this variable include:
- Keep the default value (0.1f) unless there’s a specific need to change it.
- If changing, balance between accuracy and performance. Lower values may impact performance in scenes with many skinned meshes.
- Use a negative value only if you’re certain you want to disable these updates entirely.
- Monitor performance when adjusting this value, especially in scenes with numerous or complex skinned meshes.
Regarding the associated variable GUpdateBoundsNotifyStreamingRadiusChangeRatio
:
This is a global float variable that directly corresponds to the console variable. It’s used in the USkinnedMeshComponent::UpdateBounds()
function to determine when to notify the streaming manager of changes in the bounding radius.
The variable is checked in a conditional statement that compares the current bounds radius with the last updated radius. If the difference exceeds the threshold defined by this variable, the streaming manager is notified of the update.
Developers should be aware that modifying this variable directly in code is not recommended. Instead, they should use the console variable system to ensure consistency across the engine. The global variable will automatically reflect changes made to the console variable.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:72
Scope: file
Source code excerpt:
float GUpdateBoundsNotifyStreamingRadiusChangeRatio = 0.1f;
FAutoConsoleVariableRef CVarUpdateBoundsNotifyStreamingRadiusChangeRatio(
TEXT("r.SkinnedMesh.UpdateBoundsNotifyStreamingRadiusChangeRatio"),
GUpdateBoundsNotifyStreamingRadiusChangeRatio,
TEXT("Update the streaming manager when the radius changes by more than this ratio since the last update. A negative value will disable the update."),
ECVF_Default
);
static bool GReleasePreviousLODInfoOnInitialization = true;
#Associated Variable and Callsites
This variable is associated with another variable named GUpdateBoundsNotifyStreamingRadiusChangeRatio
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:70
Scope: file
Source code excerpt:
TEXT("Visualize SkelMesh LODs"));
float GUpdateBoundsNotifyStreamingRadiusChangeRatio = 0.1f;
FAutoConsoleVariableRef CVarUpdateBoundsNotifyStreamingRadiusChangeRatio(
TEXT("r.SkinnedMesh.UpdateBoundsNotifyStreamingRadiusChangeRatio"),
GUpdateBoundsNotifyStreamingRadiusChangeRatio,
TEXT("Update the streaming manager when the radius changes by more than this ratio since the last update. A negative value will disable the update."),
ECVF_Default
);
static bool GReleasePreviousLODInfoOnInitialization = true;
static FAutoConsoleVariableRef CVarReleasePreviousLODInfoOnInitialization(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:1678
Scope (from outer to inner):
file
function void USkinnedMeshComponent::UpdateBounds
Source code excerpt:
// Only notify the streamer if the bounds radius has changed enough
if (GUpdateBoundsNotifyStreamingRadiusChangeRatio >= 0.f
&& FMath::Abs(float(Bounds.SphereRadius) - LastStreamerUpdateBoundsRadius) > GUpdateBoundsNotifyStreamingRadiusChangeRatio * FMath::Min(float(Bounds.SphereRadius), LastStreamerUpdateBoundsRadius)
&& GetForcedLOD() == 0)
{
IStreamingManager::Get().NotifyPrimitiveUpdated_Concurrent(this);
LastStreamerUpdateBoundsRadius = float(Bounds.SphereRadius);
}
}