ShowFlag.OpaqueCompositeEditorPrimitives
ShowFlag.OpaqueCompositeEditorPrimitives
#Overview
name: ShowFlag.OpaqueCompositeEditorPrimitives
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 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.OpaqueCompositeEditorPrimitives is to control the rendering of composite editor primitives in the Unreal Engine editor viewport. Specifically, it determines whether occluded portions of these primitives are drawn opaquely on top or dithered when they are occluded by other objects in the scene.
This setting variable is primarily used by the rendering system, particularly in the editor environment. Based on the callsites, it appears to be part of the Engine module and is likely utilized by the Renderer module as well.
The value of this variable is set through the SHOWFLAG_FIXED_IN_SHIPPING macro, which suggests that it’s a fixed value in shipping builds. In the provided code, it’s initialized to 0, meaning it’s disabled by default.
The OpaqueCompositeEditorPrimitives variable interacts closely with the CompositeEditorPrimitives flag. The OpaqueCompositeEditorPrimitives flag only takes effect when CompositeEditorPrimitives is enabled.
Developers should be aware that this variable is primarily intended for use in the editor environment and may not have an effect in shipping builds. It’s part of the SFG_Developer group, which further emphasizes its development-focused nature.
Best practices when using this variable include:
- Only enabling it when necessary for editing or debugging purposes.
- Being aware of its performance implications, as rendering opaque primitives on top might affect rendering performance.
- Using it in conjunction with the CompositeEditorPrimitives flag for the desired effect.
Regarding the associated variable OpaqueCompositeEditorPrimitives:
The purpose of OpaqueCompositeEditorPrimitives is the same as ShowFlag.OpaqueCompositeEditorPrimitives. It’s used to determine whether composite editor primitives should be rendered opaquely when occluded.
This variable is used in the Renderer module, specifically in the PostProcessCompositeEditorPrimitives.cpp file. It’s part of the view family’s engine show flags, suggesting it’s a render-time setting.
The value of this variable is likely set through the engine’s show flags system, which allows for runtime toggling of various rendering features.
It interacts with the Wireframe show flag. If either OpaqueCompositeEditorPrimitives or Wireframe is enabled, the bOpaqueEditorGizmo flag is set to true in the rendering code.
Developers should be aware that this setting affects the visibility and appearance of editor gizmos and other primitives, which can be crucial for clear visualization during editing.
Best practices include:
- Using this flag in conjunction with other editor visualization settings for optimal editing experience.
- Being mindful of its impact on editor performance, especially in complex scenes.
- Considering its interaction with the Wireframe mode when debugging rendering issues.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:97
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, CompositeEditorPrimitives, SFG_Developer, NSLOCTEXT("UnrealEd", "CompositeEditorPrimitivesSF", "Composite Editor Primitives"))
/** When CompositeEditorPrimitives is set, determines whether occluded portions are drawn opaquely on top, or dithered when they are occluded */
SHOWFLAG_FIXED_IN_SHIPPING(0, OpaqueCompositeEditorPrimitives, SFG_Developer, NSLOCTEXT("UnrealEd", "OpaqueCompositeEditorPrimitives", "Make Composite Editor Primitives Opaque"))
/** Shows a test image that allows to tweak the monitor colors, borders and allows to judge image and temporal aliasing */
SHOWFLAG_FIXED_IN_SHIPPING(0, TestImage, SFG_Developer, NSLOCTEXT("UnrealEd", "TestImageSF", "Test Image"))
/** Helper to tweak depth of field */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeDOF, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeDOFSF", "Depth of Field Layers"))
/** Show Vertex Colors */
SHOWFLAG_FIXED_IN_SHIPPING(0, VertexColors, SFG_Advanced, NSLOCTEXT("UnrealEd", "VertexColorsSF", "Vertex Colors"))
#Associated Variable and Callsites
This variable is associated with another variable named OpaqueCompositeEditorPrimitives
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:97
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, CompositeEditorPrimitives, SFG_Developer, NSLOCTEXT("UnrealEd", "CompositeEditorPrimitivesSF", "Composite Editor Primitives"))
/** When CompositeEditorPrimitives is set, determines whether occluded portions are drawn opaquely on top, or dithered when they are occluded */
SHOWFLAG_FIXED_IN_SHIPPING(0, OpaqueCompositeEditorPrimitives, SFG_Developer, NSLOCTEXT("UnrealEd", "OpaqueCompositeEditorPrimitives", "Make Composite Editor Primitives Opaque"))
/** Shows a test image that allows to tweak the monitor colors, borders and allows to judge image and temporal aliasing */
SHOWFLAG_FIXED_IN_SHIPPING(0, TestImage, SFG_Developer, NSLOCTEXT("UnrealEd", "TestImageSF", "Test Image"))
/** Helper to tweak depth of field */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeDOF, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeDOFSF", "Depth of Field Layers"))
/** Show Vertex Colors */
SHOWFLAG_FIXED_IN_SHIPPING(0, VertexColors, SFG_Advanced, NSLOCTEXT("UnrealEd", "VertexColorsSF", "Vertex Colors"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessCompositeEditorPrimitives.cpp:371
Scope: file
Source code excerpt:
FRHISamplerState* PointClampSampler = TStaticSamplerState<SF_Point, AM_Clamp, AM_Clamp, AM_Clamp>::GetRHI();
const bool bOpaqueEditorGizmo = View.Family->EngineShowFlags.OpaqueCompositeEditorPrimitives || View.Family->EngineShowFlags.Wireframe;
FCompositeEditorPrimitivesPS::FParameters* PassParameters = GraphBuilder.AllocParameters<FCompositeEditorPrimitivesPS::FParameters>();
PassParameters->RenderTargets[0] = Output.GetRenderTargetBinding();
PassParameters->View = View.ViewUniformBuffer;
PassParameters->Color = GetScreenPassTextureViewportParameters(FScreenPassTextureViewport(Inputs.SceneColor));
PassParameters->Depth = GetScreenPassTextureViewportParameters(FScreenPassTextureViewport(SceneDepth));