ShowFlag.VirtualTexturePrimitives

ShowFlag.VirtualTexturePrimitives

#Overview

name: ShowFlag.VirtualTexturePrimitives

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 ShowFlag.VirtualTexturePrimitives is to control the rendering of primitives that normally only contribute to runtime virtual textures. It allows these primitives to be drawn in the main pass, which is useful for debugging and development purposes.

This setting variable is primarily used by the rendering system in Unreal Engine 5. It appears to be part of the show flags system, which allows developers to toggle various rendering features on and off.

Based on the callsites, this variable is used in the Engine module, specifically in the primitive scene proxy logic. It’s likely that the rendering subsystem and virtual texturing system rely on this setting.

The value of this variable is set using the SHOWFLAG_FIXED_IN_SHIPPING macro, which suggests that it’s a developer-only feature that is fixed (likely disabled) in shipping builds. The default value is set to 0, meaning it’s off by default.

The associated variable VirtualTexturePrimitives interacts directly with ShowFlag.VirtualTexturePrimitives. They share the same value and are used interchangeably in the code.

Developers should be aware that this flag is primarily for development and debugging purposes. It’s not intended for use in shipping builds, as indicated by the SHOWFLAG_FIXED_IN_SHIPPING macro.

Best practices when using this variable include:

  1. Only enable it when specifically debugging virtual texture primitive rendering issues.
  2. Be aware that enabling this flag may impact performance, as it causes additional primitives to be rendered in the main pass.
  3. Remember to disable it when not needed to avoid unnecessary rendering overhead.

Regarding the associated variable VirtualTexturePrimitives:

The purpose of VirtualTexturePrimitives is the same as ShowFlag.VirtualTexturePrimitives. It’s used to control the rendering of primitives that normally only contribute to runtime virtual textures.

This variable is used in the Engine module, specifically in the FPrimitiveSceneProxy::IsShown function. It’s part of the logic that determines whether a primitive should be rendered.

The value of this variable is set through the show flags system, likely controlled by user interface elements in the editor or debug commands.

VirtualTexturePrimitives interacts directly with ShowFlag.VirtualTexturePrimitives, sharing the same value and purpose.

Developers should be aware that this variable affects the visibility of certain primitives. When false, primitives that are meant to only contribute to virtual textures will not be shown in the main render pass.

Best practices for using this variable include:

  1. Use it in conjunction with other virtual texturing debug tools and visualizations.
  2. Be mindful of its impact on performance and visual fidelity when enabled.
  3. Ensure it’s disabled in final builds or when not actively debugging virtual texture issues.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:412

Scope: file

Source code excerpt:


/** Draw in the main pass the primitives that would normally only contribute to runtime virtual textures. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VirtualTexturePrimitives, SFG_Developer, NSLOCTEXT("UnrealEd", "VirtualTexturePrimitivesSF", "Virtual Texture Primitives"))

/** Visualize volumetric cloud conservative density. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeVolumetricCloudConservativeDensity, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeVolumetricCloudConservativeDensitySF", "Volumetric Cloud Conservative Density"))

/** Visualize volumetric cloud density for empty space skipping. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeVolumetricCloudEmptySpaceSkipping, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeVolumetricCloudEmptySpaceSkippingSF", "Volumetric Cloud Empty Space Skipping Density"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PrimitiveSceneProxy.cpp:1474

Scope (from outer to inner):

file
function     bool FPrimitiveSceneProxy::IsShown

Source code excerpt:

		}

		if (DrawInVirtualTextureOnly(true) && !View->bIsVirtualTexture && !View->Family->EngineShowFlags.VirtualTexturePrimitives && !IsSelected())
		{
			return false;
		}
	}
	else
#endif

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:412

Scope: file

Source code excerpt:


/** Draw in the main pass the primitives that would normally only contribute to runtime virtual textures. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VirtualTexturePrimitives, SFG_Developer, NSLOCTEXT("UnrealEd", "VirtualTexturePrimitivesSF", "Virtual Texture Primitives"))

/** Visualize volumetric cloud conservative density. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeVolumetricCloudConservativeDensity, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeVolumetricCloudConservativeDensitySF", "Volumetric Cloud Conservative Density"))

/** Visualize volumetric cloud density for empty space skipping. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeVolumetricCloudEmptySpaceSkipping, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeVolumetricCloudEmptySpaceSkippingSF", "Volumetric Cloud Empty Space Skipping Density"))