r.Nanite.Visualize.PixelProgrammableVisMode
r.Nanite.Visualize.PixelProgrammableVisMode
#Overview
name: r.Nanite.Visualize.PixelProgrammableVisMode
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0: Show masked, pixel depth offset, and dynamic displacement materials.\n1: Show masked materials only.\n2: Show pixel depth offset only.\n3: Show dynamic displacement only.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Nanite.Visualize.PixelProgrammableVisMode is to control the visualization mode for Nanite’s pixel programmable rasterization features. This setting variable is specifically used for debugging and visualizing different aspects of Nanite’s rendering system.
This setting variable is primarily used in the Nanite rendering subsystem, which is part of Unreal Engine’s core rendering module. Based on the callsites, it’s clear that this variable is utilized in the NaniteVisualize.cpp file, which is responsible for various visualization modes in Nanite.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined using FAutoConsoleVariableRef, which allows it to be changed at runtime through console commands or configuration files.
The associated variable GNanitePixelProgrammableVisMode interacts directly with r.Nanite.Visualize.PixelProgrammableVisMode. They share the same value, with GNanitePixelProgrammableVisMode being the actual integer variable used in the code, while r.Nanite.Visualize.PixelProgrammableVisMode is the console variable name used to control it.
Developers must be aware that this variable affects the visualization of specific Nanite features: 0: Shows all features (masked, pixel depth offset, and dynamic displacement materials) 1: Shows only masked materials 2: Shows only pixel depth offset 3: Shows only dynamic displacement
Best practices when using this variable include:
- Use it primarily for debugging and visualization purposes, not for gameplay or final rendering.
- Be aware of the performance impact when enabling different visualization modes.
- Remember to reset it to the default value (0) when not actively debugging.
Regarding the associated variable GNanitePixelProgrammableVisMode:
The purpose of GNanitePixelProgrammableVisMode is to store the actual integer value that determines the current visualization mode for Nanite’s pixel programmable features.
This variable is used within the Nanite rendering subsystem, specifically in the visualization logic. It’s referenced in the GetVisualizeConfig function, which suggests it’s used to configure the visualization settings for Nanite.
The value of GNanitePixelProgrammableVisMode is set through the r.Nanite.Visualize.PixelProgrammableVisMode console variable. They are directly linked, so changing one will affect the other.
Developers should be aware that this variable directly controls the behavior of the visualization system. Changing its value will immediately affect what is being visualized in the Nanite system.
Best practices for using GNanitePixelProgrammableVisMode include:
- Avoid modifying this variable directly in code; instead, use the console variable to change its value.
- When debugging, check its value to ensure the correct visualization mode is active.
- Be cautious when using non-default values in shipping builds, as it may affect performance or visual output.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Nanite/NaniteVisualize.cpp:69
Scope: file
Source code excerpt:
int32 GNanitePixelProgrammableVisMode = NANITE_PIXEL_PROG_VIS_MODE_DEFAULT;
FAutoConsoleVariableRef CVarNanitePixelProgrammableVisMode(
TEXT("r.Nanite.Visualize.PixelProgrammableVisMode"),
GNanitePixelProgrammableVisMode,
TEXT("0: Show masked, pixel depth offset, and dynamic displacement materials.\n")
TEXT("1: Show masked materials only.\n")
TEXT("2: Show pixel depth offset only.\n")
TEXT("3: Show dynamic displacement only.")
);
#Associated Variable and Callsites
This variable is associated with another variable named GNanitePixelProgrammableVisMode
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Nanite/NaniteVisualize.cpp:67
Scope: file
Source code excerpt:
);
int32 GNanitePixelProgrammableVisMode = NANITE_PIXEL_PROG_VIS_MODE_DEFAULT;
FAutoConsoleVariableRef CVarNanitePixelProgrammableVisMode(
TEXT("r.Nanite.Visualize.PixelProgrammableVisMode"),
GNanitePixelProgrammableVisMode,
TEXT("0: Show masked, pixel depth offset, and dynamic displacement materials.\n")
TEXT("1: Show masked materials only.\n")
TEXT("2: Show pixel depth offset only.\n")
TEXT("3: Show dynamic displacement only.")
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Nanite/NaniteVisualize.cpp:120
Scope (from outer to inner):
file
function static FIntVector4 GetVisualizeConfig
Source code excerpt:
break;
case NANITE_VISUALIZE_PIXEL_PROGRAMMABLE_RASTER:
ModeArg = GNanitePixelProgrammableVisMode;
default:
break;
}
return FIntVector4(ModeID, ModeArg, bCompositeScene ? 1 : 0, bEdgeDetect ? 1 : 0);
}