ShowFlag.ActorColoration
ShowFlag.ActorColoration
#Overview
name: ShowFlag.ActorColoration
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 11
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.ActorColoration is to enable rendering of objects with colors based on what the actors’ coloring handlers provide. This setting is primarily used for debugging and visualization purposes in the Unreal Engine’s rendering system.
-
The Unreal Engine subsystems that rely on this setting variable include the rendering system, particularly the base pass rendering, static mesh rendering, and various scene proxies.
-
The value of this variable is typically set through the engine’s show flags system, which allows toggling of various rendering features for debugging and visualization.
-
This variable interacts with other rendering-related variables and systems, such as wireframe mode, LOD coloration, and debug view modes.
-
Developers should be aware that this variable is fixed in shipping builds (set to 0), meaning it’s primarily intended for development and debugging purposes.
-
Best practices when using this variable include:
- Using it in conjunction with other debug visualization tools for a comprehensive understanding of scene rendering.
- Being aware that enabling this flag may impact performance, so it should be used judiciously during development.
- Remembering to disable it before final builds or performance testing.
Regarding the associated variable ActorColoration:
The purpose of ActorColoration is the same as ShowFlag.ActorColoration. It is used within the engine’s code to check if the actor coloration feature is enabled.
-
This variable is used across various rendering-related components, including GeometryCache, BillboardComponent, BrushComponent, and StaticMeshRender.
-
Its value is typically derived from the engine show flags (EngineShowFlags.ActorColoration).
-
When ActorColoration is enabled, it affects how primitives are colored in the scene, often overriding default coloration with actor-specific colors.
-
Developers should be aware that this variable can significantly change the visual output of the scene and may interfere with normal material rendering.
-
Best practices include using this variable for debugging actor-specific issues, verifying actor placement or selection, and ensuring it’s properly toggled off when not needed.
Both variables work together to provide a powerful visualization tool for developers, allowing them to quickly identify and debug actor-related issues in the scene.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:283
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(Game, SFG_Hidden, NSLOCTEXT("UnrealEd", "GameSF", "Game"))
/** Render objects with colors based on what the actors coloring handlers provides */
SHOWFLAG_FIXED_IN_SHIPPING(0, ActorColoration, SFG_Transient, NSLOCTEXT("UnrealEd", "ActorColorationSF", "Actor Coloration"))
/** Draws BSP brushes (in game or editor textured triangles usually with lightmaps), for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(BSP, SFG_Normal, NSLOCTEXT("UnrealEd", "BSPSF", "BSP"))
/** Collision drawing */
SHOWFLAG_FIXED_IN_SHIPPING(0, Collision, SFG_Normal, NSLOCTEXT("UnrealEd", "CollisionWireFrame", "Collision"))
/** Collision blocking visibility against complex **/
SHOWFLAG_FIXED_IN_SHIPPING(0, CollisionVisibility, SFG_Hidden, NSLOCTEXT("UnrealEd", "CollisionVisibility", "Visibility"))
#Associated Variable and Callsites
This variable is associated with another variable named ActorColoration
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryCache/Source/GeometryCache/Private/GeometryCacheSceneProxy.cpp:409
Scope (from outer to inner):
file
function void FGeometryCacheSceneProxy::GetDynamicMeshElements
Source code excerpt:
{
const FEngineShowFlags& EngineShowFlags = ViewFamily.EngineShowFlags;
const bool bActorColorationEnabled = EngineShowFlags.ActorColoration;
const FLinearColor WireColor = bOverrideWireframeColor ? WireframeOverrideColor : GetWireframeColor();
const FLinearColor ViewWireframeColor(bActorColorationEnabled ? GetPrimitiveColor() : WireColor);
WireframeMaterialInstance = new FColoredMaterialRenderProxy(
GEngine->WireframeMaterial ? GEngine->WireframeMaterial->GetRenderProxy() : nullptr,
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/BillboardComponent.cpp:178
Scope (from outer to inner):
file
class class FSpriteSceneProxy final : public FPrimitiveSceneProxy
function virtual void GetDynamicMeshElements
Source code excerpt:
ColorToUse.A = 1.0f;
const FLinearColor& SpriteColor = View->Family->EngineShowFlags.ActorColoration ? PrimitiveColorToUse : ColorToUse;
Collector.GetPDI(ViewIndex)->DrawSprite(
Origin,
ViewedSizeX,
ViewedSizeY,
TextureResource,
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/BrushComponent.cpp:220
Scope (from outer to inner):
file
class class FBrushSceneProxy final : public FPrimitiveSceneProxy
function virtual void GetDynamicMeshElements
Source code excerpt:
DrawColor = BrushColor;
}
else if(View->Family->EngineShowFlags.ActorColoration)
{
DrawColor = ActorColor;
}
// SOLID
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PrimitiveDrawingUtils.cpp:1541
Scope (from outer to inner):
file
function bool IsRichView
Source code excerpt:
ViewFamily.EngineShowFlags.LightInfluences ||
ViewFamily.EngineShowFlags.Wireframe ||
ViewFamily.EngineShowFlags.ActorColoration ||
ViewFamily.EngineShowFlags.LODColoration ||
ViewFamily.EngineShowFlags.HLODColoration ||
ViewFamily.EngineShowFlags.MassProperties )
{
return true;
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PrimitiveDrawingUtils.cpp:1577
Scope (from outer to inner):
file
function void ApplyViewModeOverrides
Source code excerpt:
// with the level color if level coloration is enabled.
FLinearColor BaseColor( PrimitiveSceneProxy->GetWireframeColor() );
if (EngineShowFlags.ActorColoration)
{
BaseColor = PrimitiveSceneProxy->GetPrimitiveColor();
}
if (bMaterialModifiesMeshPosition)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PrimitiveDrawingUtils.cpp:1660
Scope (from outer to inner):
file
function void ApplyViewModeOverrides
Source code excerpt:
else
{
if (EngineShowFlags.ActorColoration)
{
const FLinearColor SelectionColor = GetSelectionColor(PrimitiveSceneProxy->GetPrimitiveColor(), bSelected, PrimitiveSceneProxy->IsHovered());
FMaterialRenderProxy* LevelColorationMaterialInstance = nullptr;
if (bMaterialModifiesMeshPosition)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/StaticMeshRender.cpp:1480
Scope (from outer to inner):
file
function void FStaticMeshSceneProxy::GetDynamicMeshElements
Source code excerpt:
// how we should draw the collision for this mesh.
const bool bIsWireframeView = EngineShowFlags.Wireframe;
const bool bActorColorationEnabled = EngineShowFlags.ActorColoration;
const ERHIFeatureLevel::Type FeatureLevel = ViewFamily.GetFeatureLevel();
for (int32 ViewIndex = 0; ViewIndex < Views.Num(); ViewIndex++)
{
const FSceneView* View = Views[ViewIndex];
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:283
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(Game, SFG_Hidden, NSLOCTEXT("UnrealEd", "GameSF", "Game"))
/** Render objects with colors based on what the actors coloring handlers provides */
SHOWFLAG_FIXED_IN_SHIPPING(0, ActorColoration, SFG_Transient, NSLOCTEXT("UnrealEd", "ActorColorationSF", "Actor Coloration"))
/** Draws BSP brushes (in game or editor textured triangles usually with lightmaps), for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(BSP, SFG_Normal, NSLOCTEXT("UnrealEd", "BSPSF", "BSP"))
/** Collision drawing */
SHOWFLAG_FIXED_IN_SHIPPING(0, Collision, SFG_Normal, NSLOCTEXT("UnrealEd", "CollisionWireFrame", "Collision"))
/** Collision blocking visibility against complex **/
SHOWFLAG_FIXED_IN_SHIPPING(0, CollisionVisibility, SFG_Hidden, NSLOCTEXT("UnrealEd", "CollisionVisibility", "Visibility"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.cpp:1352
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderBasePassInternal
Source code excerpt:
NaniteDebugViewMode = Nanite::EDebugViewMode::LightmapDensity;
}
else if (ViewFamily.EngineShowFlags.ActorColoration)
{
NaniteDebugViewMode = Nanite::EDebugViewMode::PrimitiveColor;
}
else if (ViewFamily.UseDebugViewPS())
{
switch (ViewFamily.GetDebugViewShaderMode())
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:1203
Scope (from outer to inner):
file
function void FViewInfo::UpdatePreExposure
Source code excerpt:
&& !ViewFamily.EngineShowFlags.LODColoration
&& !ViewFamily.EngineShowFlags.HLODColoration
&& !ViewFamily.EngineShowFlags.ActorColoration
&& ((!ViewFamily.EngineShowFlags.VisualizeBuffer) || CurrentBufferVisualizationMode != NAME_None) // disable pre-exposure for the buffer visualization modes
&& !ViewFamily.EngineShowFlags.RayTracingDebug;
// Compute the PreExposure to use.
bool bUpdateLastExposure = false;
PreExposure = 1.f;