b.NumGeneratedInstancesLimit
b.NumGeneratedInstancesLimit
#Overview
name: b.NumGeneratedInstancesLimit
The value of this variable can be defined or overridden in .ini config files. 5
.ini config files referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of b.NumGeneratedInstancesLimit is to limit the number of mutable instances with full LODs that can exist at a given time in the Unreal Engine. This setting is primarily used for performance optimization and scalability in the Mutable plugin, which is part of the Customizable Object system.
This setting variable is primarily used by the Mutable plugin, which is an experimental feature in Unreal Engine 5 for creating customizable objects. Specifically, it’s used within the CustomizableObject module.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0, which means there’s no limit by default. The value can be changed at runtime through console commands or programmatically.
The associated variable CVarNumGeneratedInstancesLimit directly interacts with b.NumGeneratedInstancesLimit. They share the same value and purpose. CVarNumGeneratedInstancesLimit is the actual TAutoConsoleVariable object that manages the console variable.
Developers must be aware that:
- This variable only takes effect when set to a value greater than 0.
- It affects performance and memory usage, as it limits the number of fully detailed (full LOD) mutable instances.
- It’s marked with ECVF_Scalability, indicating it’s intended for adjusting performance scaling.
Best practices when using this variable include:
- Use it in conjunction with profiling tools to find the optimal balance between performance and visual quality.
- Consider the target hardware when setting this value, as lower-end devices may benefit from a lower limit.
- Test thoroughly with different values to ensure it doesn’t negatively impact the visual quality of your game.
Regarding the associated variable CVarNumGeneratedInstancesLimit:
- It’s the actual console variable object that controls the b.NumGeneratedInstancesLimit setting.
- It’s used to retrieve the current value of the setting in the game thread via the GetValueOnGameThread() method.
- When working with this variable programmatically, developers should use the CVarNumGeneratedInstancesLimit object rather than trying to access b.NumGeneratedInstancesLimit directly.
- Any changes to CVarNumGeneratedInstancesLimit will directly affect the behavior controlled by b.NumGeneratedInstancesLimit.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Plugins/Experimental/Mutable/Config/DefaultMutable.ini:34, section: [ViewDistanceQuality@0]
- INI Section:
ViewDistanceQuality@0
- Raw value:
7
- Is Array:
False
Location: <Workspace>/Engine/Plugins/Experimental/Mutable/Config/DefaultMutable.ini:48, section: [ViewDistanceQuality@1]
- INI Section:
ViewDistanceQuality@1
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Plugins/Experimental/Mutable/Config/DefaultMutable.ini:50, section: [ViewDistanceQuality@2]
- INI Section:
ViewDistanceQuality@2
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Plugins/Experimental/Mutable/Config/DefaultMutable.ini:52, section: [ViewDistanceQuality@3]
- INI Section:
ViewDistanceQuality@3
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Plugins/Experimental/Mutable/Config/DefaultMutable.ini:54, section: [ViewDistanceQuality@Cine]
- INI Section:
ViewDistanceQuality@Cine
- Raw value:
0
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/CustomizableObject/Private/MuCO/CustomizableInstanceLODManagement.cpp:28
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarNumGeneratedInstancesLimit(
TEXT("b.NumGeneratedInstancesLimit"),
0,
TEXT("If different than 0, limit the number of mutable instances with full LODs to have at a given time."),
ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarNumGeneratedInstancesLimitLOD1(
TEXT("b.NumGeneratedInstancesLimitLOD1"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarNumGeneratedInstancesLimit
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/CustomizableObject/Private/MuCO/CustomizableInstanceLODManagement.cpp:27
Scope: file
Source code excerpt:
#endif
static TAutoConsoleVariable<int32> CVarNumGeneratedInstancesLimit(
TEXT("b.NumGeneratedInstancesLimit"),
0,
TEXT("If different than 0, limit the number of mutable instances with full LODs to have at a given time."),
ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarNumGeneratedInstancesLimitLOD1(
#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/CustomizableObject/Private/MuCO/CustomizableInstanceLODManagement.cpp:422
Scope (from outer to inner):
file
function int32 UCustomizableInstanceLODManagement::GetNumGeneratedInstancesLimitFullLODs
Source code excerpt:
int32 UCustomizableInstanceLODManagement::GetNumGeneratedInstancesLimitFullLODs() const
{
return CVarNumGeneratedInstancesLimit.GetValueOnGameThread();
}
int32 UCustomizableInstanceLODManagement::GetNumGeneratedInstancesLimitLOD1() const
{
return CVarNumGeneratedInstancesLimitLOD1.GetValueOnGameThread();