r.Nanite.Streaming.TranscodeWaveSize

r.Nanite.Streaming.TranscodeWaveSize

#Overview

name: r.Nanite.Streaming.TranscodeWaveSize

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Nanite.Streaming.TranscodeWaveSize is to control the wave size used for transcoding in Nanite streaming. It is part of the Nanite rendering system in Unreal Engine 5, which is responsible for high-quality, scalable geometry.

This setting variable is primarily used in the Nanite streaming subsystem, which is part of the Engine module. It specifically affects the transcoding process in Nanite streaming.

The value of this variable is set through a console variable (CVar) system. It can be set via console commands or configuration files. The default value is 0, which means automatic selection of the wave size.

The associated variable CVarNaniteStreamingTranscodeWaveSize directly interacts with r.Nanite.Streaming.TranscodeWaveSize. They share the same value and purpose.

Developers must be aware that:

  1. This variable affects performance and potentially quality of Nanite streaming.
  2. The valid values are 0 (automatic), 4, 8, 16, and 32.
  3. The chosen wave size must be between GRHIMinimumWaveSize and GRHIMaximumWaveSize, and must be a power of two.

Best practices when using this variable include:

  1. Leave it at the default value (0) for automatic selection unless there’s a specific need to override it.
  2. If overriding, choose a value that balances performance and quality for your specific use case.
  3. Test thoroughly with different values to ensure optimal performance and visual quality.

Regarding the associated variable CVarNaniteStreamingTranscodeWaveSize:

Developers should be aware that changing r.Nanite.Streaming.TranscodeWaveSize will directly affect the behavior of this internal variable and the SelectTranscodeWaveSize() function.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Rendering/NaniteStreamingManager.cpp:136

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarNaniteStreamingTranscodeWaveSize(
	TEXT("r.Nanite.Streaming.TranscodeWaveSize"), 0,
	TEXT("Overrides the wave size to use for transcoding.\n")
	TEXT(" 0: Automatic (default);\n")
	TEXT(" 4: Wave size 4;\n")
	TEXT(" 8: Wave size 8;\n")
	TEXT(" 16: Wave size 16;\n")
	TEXT(" 32: Wave size 32;\n")

#Associated Variable and Callsites

This variable is associated with another variable named CVarNaniteStreamingTranscodeWaveSize. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Rendering/NaniteStreamingManager.cpp:135

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarNaniteStreamingTranscodeWaveSize(
	TEXT("r.Nanite.Streaming.TranscodeWaveSize"), 0,
	TEXT("Overrides the wave size to use for transcoding.\n")
	TEXT(" 0: Automatic (default);\n")
	TEXT(" 4: Wave size 4;\n")
	TEXT(" 8: Wave size 8;\n")
	TEXT(" 16: Wave size 16;\n")

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Rendering/NaniteStreamingManager.cpp:404

Scope (from outer to inner):

file
function     static int32 SelectTranscodeWaveSize

Source code excerpt:

static int32 SelectTranscodeWaveSize()
{
	const int32 WaveSizeOverride = CVarNaniteStreamingTranscodeWaveSize.GetValueOnRenderThread();

	int32 WaveSize = 0;
	if (WaveSizeOverride != 0 && WaveSizeOverride >= GRHIMinimumWaveSize && WaveSizeOverride <= GRHIMaximumWaveSize && FMath::IsPowerOfTwo(WaveSizeOverride))
	{
		WaveSize = WaveSizeOverride;
	}