Slate.DefaultEnablePostRenderTarget_0

Slate.DefaultEnablePostRenderTarget_0

#Overview

name: Slate.DefaultEnablePostRenderTarget_0

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 Slate.DefaultEnablePostRenderTarget_0 is to control the enablement of Slate’s post-render target 0, which is part of the Slate rendering system in Unreal Engine 5.

This setting variable is primarily used by the SlateRHIRenderer module, which is responsible for rendering Slate UI elements using the RHI (Rendering Hardware Interface). It specifically affects the post-processing stage of Slate rendering.

The value of this variable is set as a console variable (CVar) with a default value of 1 (true). It is defined as a TAutoConsoleVariable named CVarDefaultEnablePostRenderTarget_0.

The main variable that interacts with Slate.DefaultEnablePostRenderTarget_0 is CVarDefaultEnablePostRenderTarget_0. This console variable is used to retrieve the actual value of the setting and apply it to the Slate post-processing settings.

Developers should be aware that this feature is marked as experimental, as indicated by the comment in the source code. This means that its behavior or implementation may change in future versions of the engine.

Best practices when using this variable include:

  1. Consider the performance implications of enabling post-render targets, as they can impact rendering performance.
  2. Test thoroughly when enabling or disabling this feature, as it may affect the visual output of your UI.
  3. Keep in mind that this is an experimental feature, so be prepared for potential changes in future engine versions.

Regarding the associated variable CVarDefaultEnablePostRenderTarget_0:

This is a console variable that directly corresponds to the Slate.DefaultEnablePostRenderTarget_0 setting. It is used to store and retrieve the value of the setting within the engine’s code.

The purpose of CVarDefaultEnablePostRenderTarget_0 is to provide a programmatic way to access and modify the Slate.DefaultEnablePostRenderTarget_0 setting at runtime.

This variable is used in the SlateRHIRenderer module to initialize the Slate post-processing settings. Specifically, it sets the ‘bEnabled’ flag for the first post-render target (ESlatePostRT_0) in the USlateRHIRendererSettings class.

The value of CVarDefaultEnablePostRenderTarget_0 is set when the console variable is created, with a default value of 1 (true). It can be modified through console commands or programmatically.

Developers should be aware that this variable is marked as ECVF_ReadOnly, which means it cannot be changed at runtime through normal means. This is likely to ensure consistency in the rendering pipeline.

Best practices for using CVarDefaultEnablePostRenderTarget_0 include:

  1. Use GetValueOnAnyThread() to safely retrieve its value from any thread.
  2. Avoid attempting to modify this variable at runtime due to its read-only nature.
  3. Consider the implications on Slate rendering performance when this variable is enabled.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateRHIRendererSettings.cpp:8

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarDefaultEnablePostRenderTarget_0(
	TEXT("Slate.DefaultEnablePostRenderTarget_0"),
	1,
	TEXT("Experimental. Set true to enable slate post render target 0"),
	ECVF_ReadOnly);

FSlatePostSettings::FSlatePostSettings()
	: bEnabled(false)

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateRHIRendererSettings.cpp:7

Scope: file

Source code excerpt:

#include UE_INLINE_GENERATED_CPP_BY_NAME(SlateRHIRendererSettings)

static TAutoConsoleVariable<int32> CVarDefaultEnablePostRenderTarget_0(
	TEXT("Slate.DefaultEnablePostRenderTarget_0"),
	1,
	TEXT("Experimental. Set true to enable slate post render target 0"),
	ECVF_ReadOnly);

FSlatePostSettings::FSlatePostSettings()

#Loc: <Workspace>/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateRHIRendererSettings.cpp:31

Scope (from outer to inner):

file
function     USlateRHIRendererSettings::USlateRHIRendererSettings

Source code excerpt:


	// By default, enable the first post RT
	SlatePostSettings[ESlatePostRT::ESlatePostRT_0].bEnabled = CVarDefaultEnablePostRenderTarget_0.GetValueOnAnyThread();

	// Hardcoded paths to engine assets
	SlatePostSettings[ESlatePostRT::ESlatePostRT_0].PathToSlatePostRT = "/Engine/EngineResources/SlatePost0_RT.SlatePost0_RT";
	SlatePostSettings[ESlatePostRT::ESlatePostRT_1].PathToSlatePostRT = "/Engine/EngineResources/SlatePost1_RT.SlatePost1_RT";
	SlatePostSettings[ESlatePostRT::ESlatePostRT_2].PathToSlatePostRT = "/Engine/EngineResources/SlatePost2_RT.SlatePost2_RT";
	SlatePostSettings[ESlatePostRT::ESlatePostRT_3].PathToSlatePostRT = "/Engine/EngineResources/SlatePost3_RT.SlatePost3_RT";