r.Nanite.RasterIndirectionMultiplier
r.Nanite.RasterIndirectionMultiplier
#Overview
name: r.Nanite.RasterIndirectionMultiplier
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Nanite.RasterIndirectionMultiplier is to control the maximum number of unique materials per visible cluster in Unreal Engine 5’s Nanite rendering system. This setting variable is specifically used in the rasterization process of Nanite, which is part of the engine’s advanced geometry system.
This setting variable is primarily used in the Nanite subsystem of Unreal Engine’s rendering module. It’s referenced in the NaniteCullRaster.cpp file, which suggests it’s involved in the culling and rasterization processes of Nanite geometry.
The value of this variable is set as a console variable with a default value of 3.0f. It can be modified at runtime through the console or through configuration files.
The associated variable CVarNaniteRasterIndirectionMultiplier directly interacts with r.Nanite.RasterIndirectionMultiplier. They share the same value and are used interchangeably in the code.
Developers should be aware that this variable affects the memory allocation for visible clusters in Nanite. It’s used to calculate the MaxClusterIndirections, which determines the size of the buffer used for raster bin data. Changing this value will impact memory usage and potentially performance.
Best practices when using this variable include:
- Only modify it if you understand the implications on memory usage and performance.
- Monitor performance and memory usage when adjusting this value.
- Consider the types of materials and geometry in your scene when tuning this value.
Regarding the associated variable CVarNaniteRasterIndirectionMultiplier:
The purpose of CVarNaniteRasterIndirectionMultiplier is the same as r.Nanite.RasterIndirectionMultiplier. It’s a console variable that allows runtime modification of the raster indirection multiplier.
This variable is used in the Nanite rendering system, specifically in the culling and rasterization processes.
The value is set when the console variable is initialized, with a default value of 3.0f.
It directly interacts with r.Nanite.RasterIndirectionMultiplier, as they share the same value.
Developers should be aware that this is the actual variable used in the code to retrieve the current value of the setting (using GetValueOnRenderThread()).
Best practices include using this variable to read the current value of the setting in render thread-safe contexts, and potentially modifying it through the console for debugging or performance tuning purposes.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Nanite/NaniteCullRaster.cpp:185
Scope: file
Source code excerpt:
// Support a max of 3 unique materials per visible cluster (i.e. if all clusters are fast path and use full range, never run out of space).
static TAutoConsoleVariable<float> CVarNaniteRasterIndirectionMultiplier(
TEXT("r.Nanite.RasterIndirectionMultiplier"),
3.0f,
TEXT(""),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarNaniteCullingHZB(
#Associated Variable and Callsites
This variable is associated with another variable named CVarNaniteRasterIndirectionMultiplier
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Nanite/NaniteCullRaster.cpp:184
Scope: file
Source code excerpt:
// Support a max of 3 unique materials per visible cluster (i.e. if all clusters are fast path and use full range, never run out of space).
static TAutoConsoleVariable<float> CVarNaniteRasterIndirectionMultiplier(
TEXT("r.Nanite.RasterIndirectionMultiplier"),
3.0f,
TEXT(""),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Nanite/NaniteCullRaster.cpp:3639
Scope (from outer to inner):
file
namespace Nanite
function FBinningData FRenderer::AddPass_Binning
Source code excerpt:
const uint32 MaxVisibleClusters = Nanite::FGlobalResources::GetMaxVisibleClusters();
const uint32 MaxClusterIndirections = uint32(float(MaxVisibleClusters) * FMath::Max<float>(1.0f, CVarNaniteRasterIndirectionMultiplier.GetValueOnRenderThread()));
check(MaxClusterIndirections > 0);
BinningData.DataBuffer = GraphBuilder.CreateBuffer(FRDGBufferDesc::CreateStructuredDesc(sizeof(uint32) * 2, MaxClusterIndirections), TEXT("Nanite.RasterBinData"));
FRasterBinBuild_CS::FParameters* PassParameters = GraphBuilder.AllocParameters<FRasterBinBuild_CS::FParameters>();
PassParameters->Scene = SceneUniformBuffer;