ShowFlag.BillboardSprites

ShowFlag.BillboardSprites

#Overview

name: ShowFlag.BillboardSprites

This variable is created as a Console Variable (cvar).

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ShowFlag.BillboardSprites is to control the visibility of billboard sprite components in the Unreal Engine rendering system. It is primarily used for debugging and visualization purposes in the editor and development builds.

This setting variable is mainly relied upon by the Engine module, specifically in the components system. It affects the rendering of ArrowComponent, BillboardComponent, and MaterialBillboardComponent.

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. It is defined as a fixed show flag in shipping builds with a default value of 1 (enabled).

The BillboardSprites variable interacts with other variables in the following ways:

  1. It is used in conjunction with sprite category visibility in editor builds.
  2. It affects the view relevance of billboard components.

Developers must be aware of the following when using this variable:

  1. It is primarily intended for editor and development use, as it is fixed in shipping builds.
  2. Disabling this flag will hide all billboard sprites, which can affect debugging and visualization of certain components.

Best practices when using this variable include:

  1. Use it for debugging and visualization purposes during development.
  2. Be cautious when disabling it, as it may hide important visual cues in the editor.
  3. Remember that it won’t have an effect in shipping builds, so don’t rely on it for gameplay-critical features.

The associated variable BillboardSprites is used in the same context as ShowFlag.BillboardSprites. It is a property of various components (such as ArrowComponent) that determines whether the component should be treated as a sprite and be affected by the ShowFlag.BillboardSprites setting.

When using the BillboardSprites property:

  1. Set it to true for components that should be affected by the ShowFlag.BillboardSprites setting.
  2. Use it to selectively control which components are treated as sprites and which are not.
  3. Be aware that it interacts with the engine show flags system and may affect visibility in the editor and development builds.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

SHOWFLAG_ALWAYS_ACCESSIBLE(Translucency, SFG_Normal, NSLOCTEXT("UnrealEd", "TranslucencySF", "Translucency"))
/** Draw billboard components */
SHOWFLAG_FIXED_IN_SHIPPING(1, BillboardSprites, SFG_Advanced, NSLOCTEXT("UnrealEd", "BillboardSpritesSF", "Billboard Sprites"))
/** Use LOD parenting, MinDrawDistance, etc. If disabled, will show LOD parenting lines */
SHOWFLAG_ALWAYS_ACCESSIBLE(LOD, SFG_Advanced, NSLOCTEXT("UnrealEd", "LODSF", "LOD Parenting"))
/** needed for VMI_LightComplexity */
SHOWFLAG_FIXED_IN_SHIPPING(0, LightComplexity, SFG_Hidden, NSLOCTEXT("UnrealEd", "LightComplexitySF", "Light Complexity"))
/** needed for VMI_ShaderComplexity, render world colored by shader complexity */
SHOWFLAG_FIXED_IN_SHIPPING(0, ShaderComplexity, SFG_Hidden, NSLOCTEXT("UnrealEd", "ShaderComplexitySF", "Shader Complexity"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Components/ArrowComponent.h:40

Scope (from outer to inner):

file
class        class UArrowComponent : public UPrimitiveComponent

Source code excerpt:

	uint8 bIsScreenSizeScaled : 1;

	/** If true, don't show the arrow when EngineShowFlags.BillboardSprites is disabled. */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintSetter=SetTreatAsASprite, Category=ArrowComponent)
	uint8 bTreatAsASprite : 1;

#if WITH_EDITORONLY_DATA
	/** Sprite category that the arrow component belongs to, if being treated as a sprite. Value serves as a key into the localization file. */
	UPROPERTY()

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/ArrowComponent.cpp:166

Scope (from outer to inner):

file
class        class FArrowSceneProxy final : public FPrimitiveSceneProxy
function     virtual FPrimitiveViewRelevance GetViewRelevance

Source code excerpt:

	{
		FPrimitiveViewRelevance Result;
		Result.bDrawRelevance = IsShown(View) && (View->Family->EngineShowFlags.BillboardSprites);
		Result.bDynamicRelevance = true;
#if WITH_EDITOR
		if (bTreatAsASprite)
		{
			if ( GIsEditor && SpriteCategoryIndex != INDEX_NONE && SpriteCategoryIndex < View->SpriteCategoryVisibility.Num() && !View->SpriteCategoryVisibility[ SpriteCategoryIndex ] )
			{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/BillboardComponent.cpp:209

Scope (from outer to inner):

file
class        class FSpriteSceneProxy final : public FPrimitiveSceneProxy
function     virtual FPrimitiveViewRelevance GetViewRelevance

Source code excerpt:

	virtual FPrimitiveViewRelevance GetViewRelevance(const FSceneView* View) const override
	{
		bool bVisible = View->Family->EngineShowFlags.BillboardSprites;
#if WITH_EDITOR
		if ( GIsEditor && bVisible && SpriteCategoryIndex != INDEX_NONE && SpriteCategoryIndex < View->SpriteCategoryVisibility.Num() )
		{
			bVisible = View->SpriteCategoryVisibility[ SpriteCategoryIndex ];
		}
#endif

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/BillboardComponent.cpp:316

Scope (from outer to inner):

file
function     bool UBillboardComponent::IsShown

Source code excerpt:

bool UBillboardComponent::IsShown(const FEngineShowFlags& ShowFlags) const
{
	return ShowFlags.BillboardSprites;
}

#if WITH_EDITOR
bool UBillboardComponent::ComponentIsTouchingSelectionBox(const FBox& InSelBBox, const bool bConsiderOnlyBSP, const bool bMustEncompassEntireComponent) const
{
	AActor* Actor = GetOwner();

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/MaterialBillboardComponent.cpp:238

Scope (from outer to inner):

file
class        class FMaterialSpriteSceneProxy final : public FPrimitiveSceneProxy
function     virtual FPrimitiveViewRelevance GetViewRelevance

Source code excerpt:

	virtual FPrimitiveViewRelevance GetViewRelevance(const FSceneView* View) const override
	{
		bool bVisible = View->Family->EngineShowFlags.BillboardSprites;
		FPrimitiveViewRelevance Result;
		Result.bDrawRelevance = IsShown(View);
		Result.bDynamicRelevance = true;
		Result.bShadowRelevance = IsShadowCast(View);
		MaterialRelevance.SetPrimitiveViewRelevance(Result);
		Result.bVelocityRelevance = DrawsVelocity() && Result.bOpaque && Result.bRenderInMainPass;

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

Scope: file

Source code excerpt:

SHOWFLAG_ALWAYS_ACCESSIBLE(Translucency, SFG_Normal, NSLOCTEXT("UnrealEd", "TranslucencySF", "Translucency"))
/** Draw billboard components */
SHOWFLAG_FIXED_IN_SHIPPING(1, BillboardSprites, SFG_Advanced, NSLOCTEXT("UnrealEd", "BillboardSpritesSF", "Billboard Sprites"))
/** Use LOD parenting, MinDrawDistance, etc. If disabled, will show LOD parenting lines */
SHOWFLAG_ALWAYS_ACCESSIBLE(LOD, SFG_Advanced, NSLOCTEXT("UnrealEd", "LODSF", "LOD Parenting"))
/** needed for VMI_LightComplexity */
SHOWFLAG_FIXED_IN_SHIPPING(0, LightComplexity, SFG_Hidden, NSLOCTEXT("UnrealEd", "LightComplexitySF", "Light Complexity"))
/** needed for VMI_ShaderComplexity, render world colored by shader complexity */
SHOWFLAG_FIXED_IN_SHIPPING(0, ShaderComplexity, SFG_Hidden, NSLOCTEXT("UnrealEd", "ShaderComplexitySF", "Shader Complexity"))