b.NumGeneratedInstancesLimitLOD1
b.NumGeneratedInstancesLimitLOD1
#Overview
name: b.NumGeneratedInstancesLimitLOD1
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of b.NumGeneratedInstancesLimitLOD1 is to limit the number of mutable instances with LOD (Level of Detail) 1 that can exist at a given time in the game.
This setting variable is primarily used by the Mutable plugin, which is part of Unreal Engine’s experimental features. Specifically, it’s utilized in the CustomizableObject module, which deals with runtime-modifiable 3D objects.
The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with an initial value of 0, meaning there’s no limit by default.
The associated variable CVarNumGeneratedInstancesLimitLOD1 directly interacts with b.NumGeneratedInstancesLimitLOD1. They share the same value and purpose. The CVarNumGeneratedInstancesLimitLOD1 is used to access the value of b.NumGeneratedInstancesLimitLOD1 in the code.
Developers must be aware that:
- This variable only affects LOD 1 instances.
- A value of 0 means no limit is applied.
- The limit is applied at runtime and can affect performance and memory usage.
Best practices when using this variable include:
- Use it judiciously to balance between performance and visual quality.
- Test thoroughly with different values to find the optimal limit for your specific use case.
- Consider the target hardware capabilities when setting this limit.
Regarding the associated variable CVarNumGeneratedInstancesLimitLOD1:
- Its purpose is to provide programmatic access to the b.NumGeneratedInstancesLimitLOD1 value.
- It’s used within the CustomizableInstanceLODManagement class to retrieve the current limit value.
- The value is accessed using the GetValueOnGameThread() method, ensuring thread-safe access.
- Developers should use this variable when they need to read the current limit value in C++ code.
- Best practice is to use the provided getter method (GetNumGeneratedInstancesLimitLOD1()) rather than accessing the CVar directly, as this maintains proper encapsulation and allows for future changes in how the value is stored or retrieved.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Plugins/Experimental/Mutable/Config/DefaultMutable.ini:37, section: [ViewDistanceQuality@0]
- INI Section:
ViewDistanceQuality@0
- 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:34
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarNumGeneratedInstancesLimitLOD1(
TEXT("b.NumGeneratedInstancesLimitLOD1"),
0,
TEXT("If different than 0, limit the number of mutable instances with LOD 1 to have at a given time."),
ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarNumGeneratedInstancesLimitLOD2(
TEXT("b.NumGeneratedInstancesLimitLOD2"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarNumGeneratedInstancesLimitLOD1
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/CustomizableObject/Private/MuCO/CustomizableInstanceLODManagement.cpp:33
Scope: file
Source code excerpt:
ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarNumGeneratedInstancesLimitLOD1(
TEXT("b.NumGeneratedInstancesLimitLOD1"),
0,
TEXT("If different than 0, limit the number of mutable instances with LOD 1 to have at a given time."),
ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarNumGeneratedInstancesLimitLOD2(
#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/CustomizableObject/Private/MuCO/CustomizableInstanceLODManagement.cpp:428
Scope (from outer to inner):
file
function int32 UCustomizableInstanceLODManagement::GetNumGeneratedInstancesLimitLOD1
Source code excerpt:
int32 UCustomizableInstanceLODManagement::GetNumGeneratedInstancesLimitLOD1() const
{
return CVarNumGeneratedInstancesLimitLOD1.GetValueOnGameThread();
}
int32 UCustomizableInstanceLODManagement::GetNumGeneratedInstancesLimitLOD2() const
{
return CVarNumGeneratedInstancesLimitLOD2.GetValueOnGameThread();