ShowFlag.CameraFrustums

ShowFlag.CameraFrustums

#Overview

name: ShowFlag.CameraFrustums

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.CameraFrustums is to control the visualization of camera frustums in the Unreal Engine editor and development builds. It is primarily used for debugging and visualization purposes in the rendering system.

This setting variable is mainly relied upon by the rendering subsystem of Unreal Engine, specifically within the Engine module. It’s used to determine whether camera frustums should be drawn in the viewport.

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

The associated variable CameraFrustums interacts directly with ShowFlag.CameraFrustums. They share the same value and purpose, with CameraFrustums being used in the actual rendering code to check if camera frustums should be drawn.

Developers must be aware that this variable is only available in non-shipping builds, as indicated by the SHOWFLAG_FIXED_IN_SHIPPING macro. It’s intended for development and debugging purposes and won’t be accessible in final, shipped versions of the game.

Best practices when using this variable include:

  1. Use it primarily for debugging camera setups and understanding view frustums.
  2. Remember to disable it in performance-critical scenarios, as drawing additional debug geometry can impact frame rates.
  3. Combine it with other visualization tools to get a comprehensive understanding of the scene’s rendering.

Regarding the associated variable CameraFrustums:

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, MassProperties, SFG_Advanced, NSLOCTEXT("UnrealEd", "MassPropertiesSF", "Mass Properties"))
/** Draws camera frustums */
SHOWFLAG_FIXED_IN_SHIPPING(0, CameraFrustums, SFG_Advanced, NSLOCTEXT("UnrealEd", "CameraFrustumsSF", "Camera Frustums"))
/** Draw sound actor radii */
SHOWFLAG_FIXED_IN_SHIPPING(0, AudioRadius, SFG_Advanced, NSLOCTEXT("UnrealEd", "AudioRadiusSF", "Audio Radius"))
/** Draw force feedback radii */
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"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/DrawFrustumComponent.cpp:121

Scope (from outer to inner):

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

Source code excerpt:

	{
		FPrimitiveViewRelevance Result;
		Result.bDrawRelevance = IsShown(View) && View->Family->EngineShowFlags.CameraFrustums && bFrustumEnabled;
		Result.bDynamicRelevance = true;
		Result.bShadowRelevance = IsShadowCast(View);
		Result.bEditorPrimitiveRelevance = UseEditorCompositing(View);
		return Result;
	}

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

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, MassProperties, SFG_Advanced, NSLOCTEXT("UnrealEd", "MassPropertiesSF", "Mass Properties"))
/** Draws camera frustums */
SHOWFLAG_FIXED_IN_SHIPPING(0, CameraFrustums, SFG_Advanced, NSLOCTEXT("UnrealEd", "CameraFrustumsSF", "Camera Frustums"))
/** Draw sound actor radii */
SHOWFLAG_FIXED_IN_SHIPPING(0, AudioRadius, SFG_Advanced, NSLOCTEXT("UnrealEd", "AudioRadiusSF", "Audio Radius"))
/** Draw force feedback radii */
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"))