ShowFlag.BSPSplit
ShowFlag.BSPSplit
#Overview
name: ShowFlag.BSPSplit
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows to override a specific showflag (works in editor and game, \
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.BSPSplit is to enable a visualization mode that colors Binary Space Partitioning (BSP) geometry based on model component association. This setting is primarily used for debugging and development purposes in the Unreal Engine’s rendering system.
This setting variable is primarily used by the Engine module, specifically in the rendering and primitive drawing subsystems. It’s referenced in the PrimitiveDrawingUtils.cpp file, which suggests it’s closely tied to how primitives are rendered in the engine.
The value of this variable is set through the engine’s show flags system. It’s defined in the ShowFlagsValues.inl file with the SHOWFLAG_FIXED_IN_SHIPPING macro, indicating that it’s not available in shipping builds of games.
The BSPSplit variable interacts with other show flags and is used in conjunction with other rendering options. For example, it’s checked alongside other show flags like LightComplexity, StationaryLightOverlap, and LightMapDensity in the IsRichView function.
Developers should be aware that this variable is primarily for development and debugging purposes. It’s not intended for use in shipping games, as indicated by the SHOWFLAG_FIXED_IN_SHIPPING macro. Using this flag will impact rendering performance, so it should be used judiciously during development.
Best practices for using this variable include:
- Only enable it when specifically debugging BSP-related issues or visualizing model component associations.
- Disable it in performance-critical scenarios or when preparing builds for release.
- Use it in conjunction with other debug visualization tools to get a comprehensive view of the scene’s structure.
Regarding the associated variable BSPSplit, it appears to be the same variable, just referenced without the ShowFlag prefix. It’s used in the same context and serves the same purpose. The usage in ApplyViewModeOverrides function shows that when this flag is enabled, a unique color is assigned to each BSP model component, which is likely what creates the visual distinction in the editor viewport.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:225
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, ForceFeedbackRadius, SFG_Advanced, NSLOCTEXT("UnrealEd", "ForceFeedbackSF", "Force Feedback Radius"))
/** Colors BSP based on model component association */
SHOWFLAG_FIXED_IN_SHIPPING(0, BSPSplit, SFG_Advanced, NSLOCTEXT("UnrealEd", "BSPSplitSF", "BSP Split"))
/** show editor (wireframe) brushes, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_FIXED_IN_SHIPPING(0, Brushes, SFG_Hidden, NSLOCTEXT("UnrealEd", "BrushesSF", "Brushes"))
/** Show the usual material light interaction */
SHOWFLAG_ALWAYS_ACCESSIBLE(Lighting, SFG_Hidden, NSLOCTEXT("UnrealEd", "LightingSF", "Lighting"))
/** Execute the deferred light passes, can be disabled for debugging, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(DeferredLighting, SFG_Advanced, NSLOCTEXT("UnrealEd", "DeferredLightingSF", "DeferredLighting"))
#Associated Variable and Callsites
This variable is associated with another variable named BSPSplit
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PrimitiveDrawingUtils.cpp:1536
Scope (from outer to inner):
file
function bool IsRichView
Source code excerpt:
ViewFamily.EngineShowFlags.LightComplexity ||
ViewFamily.EngineShowFlags.StationaryLightOverlap ||
ViewFamily.EngineShowFlags.BSPSplit ||
ViewFamily.EngineShowFlags.LightMapDensity ||
ViewFamily.EngineShowFlags.MeshEdges ||
ViewFamily.EngineShowFlags.LightInfluences ||
ViewFamily.EngineShowFlags.Wireframe ||
ViewFamily.EngineShowFlags.ActorColoration ||
ViewFamily.EngineShowFlags.LODColoration ||
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PrimitiveDrawingUtils.cpp:1680
Scope (from outer to inner):
file
function void ApplyViewModeOverrides
Source code excerpt:
Collector.RegisterOneFrameMaterialProxy(LevelColorationMaterialInstance);
}
else if (EngineShowFlags.BSPSplit
&& PrimitiveSceneProxy->ShowInBSPSplitViewmode())
{
// Determine unique color for model component.
FLinearColor BSPSplitColor;
FRandomStream RandomStream(GetTypeHash(PrimitiveSceneProxy->GetPrimitiveComponentId().PrimIDValue));
BSPSplitColor.R = RandomStream.GetFraction();
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:225
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, ForceFeedbackRadius, SFG_Advanced, NSLOCTEXT("UnrealEd", "ForceFeedbackSF", "Force Feedback Radius"))
/** Colors BSP based on model component association */
SHOWFLAG_FIXED_IN_SHIPPING(0, BSPSplit, SFG_Advanced, NSLOCTEXT("UnrealEd", "BSPSplitSF", "BSP Split"))
/** show editor (wireframe) brushes, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_FIXED_IN_SHIPPING(0, Brushes, SFG_Hidden, NSLOCTEXT("UnrealEd", "BrushesSF", "Brushes"))
/** Show the usual material light interaction */
SHOWFLAG_ALWAYS_ACCESSIBLE(Lighting, SFG_Hidden, NSLOCTEXT("UnrealEd", "LightingSF", "Lighting"))
/** Execute the deferred light passes, can be disabled for debugging, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(DeferredLighting, SFG_Advanced, NSLOCTEXT("UnrealEd", "DeferredLightingSF", "DeferredLighting"))