r.PostProcessing.DisableMaterials

r.PostProcessing.DisableMaterials

#Overview

name: r.PostProcessing.DisableMaterials

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 r.PostProcessing.DisableMaterials is to allow disabling of post-process materials in the rendering system of Unreal Engine 5.

This setting variable is primarily used in the Renderer module, specifically in the post-processing subsystem. It’s referenced in the PostProcessMaterial.cpp file, which suggests it’s closely tied to the post-processing pipeline.

The value of this variable is set through a console variable (CVarPostProcessingDisableMaterials) with an initial value of 0. This means post-process materials are enabled by default.

The associated variable CVarPostProcessingDisableMaterials interacts directly with r.PostProcessing.DisableMaterials. They share the same value and purpose.

Developers must be aware that:

  1. This variable is marked with ECVF_Scalability and ECVF_RenderThreadSafe flags, indicating it’s safe to modify on the render thread and can be used for scalability settings.
  2. Setting this variable to a non-zero value will disable post-process materials, which could significantly affect the visual output of the game.

Best practices when using this variable include:

  1. Use it for performance optimization in scenarios where post-process materials are not critical.
  2. Be cautious when disabling post-process materials as it may drastically change the game’s visual appearance.
  3. Consider using it in conjunction with other rendering settings for a balanced approach to performance optimization.

Regarding the associated variable CVarPostProcessingDisableMaterials:

Best practices for CVarPostProcessingDisableMaterials include:

  1. Use it for debugging or profiling purposes to isolate the impact of post-process materials.
  2. Consider exposing it as a graphics option for users with lower-end hardware.
  3. Be mindful of its impact on visual consistency when changing its value during gameplay.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessMaterial.cpp:49

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


TAutoConsoleVariable<int32> CVarPostProcessingDisableMaterials(
	TEXT("r.PostProcessing.DisableMaterials"),
	0,
	TEXT(" Allows to disable post process materials. \n"),
	ECVF_Scalability | ECVF_RenderThreadSafe);

static bool IsPostProcessStencilTestAllowed()
{

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessMaterial.cpp:48

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

	);

TAutoConsoleVariable<int32> CVarPostProcessingDisableMaterials(
	TEXT("r.PostProcessing.DisableMaterials"),
	0,
	TEXT(" Allows to disable post process materials. \n"),
	ECVF_Scalability | ECVF_RenderThreadSafe);

static bool IsPostProcessStencilTestAllowed()

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessMaterial.cpp:913

Scope (from outer to inner):

file
function     static bool IsPostProcessMaterialsEnabledForView

Source code excerpt:

		!View.Family->EngineShowFlags.PostProcessMaterial ||
		View.Family->EngineShowFlags.VisualizeShadingModels ||
		CVarPostProcessingDisableMaterials.GetValueOnRenderThread() != 0)
	{
		return false;
	}

	return true;
}