ShowFlag.HISMCClusterTree

ShowFlag.HISMCClusterTree

#Overview

name: ShowFlag.HISMCClusterTree

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.HISMCClusterTree is to allow visualization of the cluster tree bounds used for generating occlusion bounds and culling in Hierarchical Instanced Static Mesh (HISM) and Foliage systems.

This setting variable is primarily used in the rendering system, specifically for the Hierarchical Instanced Static Mesh (HISM) and Foliage subsystems within Unreal Engine 5.

Based on the callsites, this variable is utilized in the Engine module, particularly in the HierarchicalInstancedStaticMesh component.

The value of this variable is set through the engine’s show flags system, which is typically controlled via the editor UI or through code that manipulates engine show flags.

The associated variable HISMCClusterTree interacts directly with ShowFlag.HISMCClusterTree, as they share the same value and purpose.

Developers must be aware that this variable is intended for debugging and visualization purposes. It’s marked as SHOWFLAG_FIXED_IN_SHIPPING(0, …), which means it’s disabled in shipping builds.

Best practices when using this variable include:

  1. Use it during development and debugging phases to visualize and understand the HISM/Foliage cluster tree.
  2. Be aware that enabling this flag may have performance implications, so it should be used judiciously.
  3. Remember to disable it in final builds, as it’s not meant for end-users.

Regarding the associated variable HISMCClusterTree:

The purpose of HISMCClusterTree is the same as ShowFlag.HISMCClusterTree - to control the visualization of the HISM/Foliage cluster tree.

It’s used within the FHierarchicalStaticMeshSceneProxy class to determine whether to render the cluster tree visualization.

The value is set based on the engine show flags (View->Family->EngineShowFlags.HISMCClusterTree).

This variable interacts directly with the engine show flags system.

Developers should be aware that this variable controls the actual rendering of the cluster tree visualization when the show flag is enabled.

Best practices include using this variable in conjunction with debugging tools and performance profiling to optimize HISM and Foliage rendering.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, HISMCOcclusionBounds, SFG_Advanced, NSLOCTEXT("UnrealEd", "HISMOcclusionBoundsSF", "HISM/Foliage Occlusion Bounds"))
/** Allow to see the cluster tree bounds used used to generate the occlusion bounds and in the culling */
SHOWFLAG_FIXED_IN_SHIPPING(0, HISMCClusterTree, SFG_Advanced, NSLOCTEXT("UnrealEd", "HISMClusterTreeSF", "HISM/Foliage Cluster Tree"))
/** Allow to see where each instance is in each ISM Component */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeInstanceUpdates, SFG_Advanced, NSLOCTEXT("UnrealEd", "VisualizeInstanceUpdatesSF", "Visualize Instance Updates"))
/** Draws instanced grass, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(InstancedGrass, SFG_Advanced, NSLOCTEXT("UnrealEd", "InstancedGrassSF", "Grass"))
/** non baked shadows, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(DynamicShadows, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "DynamicShadowsSF", "Dynamic Shadows"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/HierarchicalInstancedStaticMesh.cpp:1933

Scope (from outer to inner):

file
function     void FHierarchicalStaticMeshSceneProxy::GetDynamicMeshElements

Source code excerpt:

			}

			if (View->Family->EngineShowFlags.HISMCClusterTree)
			{
				FColor StartingColor(100, 0, 0);
				const float MaxWorldPositionOffset = GetMaxWorldPositionOffsetExtent();

				for (const FClusterNode& CulsterNode : ClusterTree)
				{

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

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, HISMCOcclusionBounds, SFG_Advanced, NSLOCTEXT("UnrealEd", "HISMOcclusionBoundsSF", "HISM/Foliage Occlusion Bounds"))
/** Allow to see the cluster tree bounds used used to generate the occlusion bounds and in the culling */
SHOWFLAG_FIXED_IN_SHIPPING(0, HISMCClusterTree, SFG_Advanced, NSLOCTEXT("UnrealEd", "HISMClusterTreeSF", "HISM/Foliage Cluster Tree"))
/** Allow to see where each instance is in each ISM Component */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeInstanceUpdates, SFG_Advanced, NSLOCTEXT("UnrealEd", "VisualizeInstanceUpdatesSF", "Visualize Instance Updates"))
/** Draws instanced grass, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(InstancedGrass, SFG_Advanced, NSLOCTEXT("UnrealEd", "InstancedGrassSF", "Grass"))
/** non baked shadows, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(DynamicShadows, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "DynamicShadowsSF", "Dynamic Shadows"))