r.SceneColorFringe.Max

r.SceneColorFringe.Max

#Overview

name: r.SceneColorFringe.Max

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.SceneColorFringe.Max is to control the maximum intensity of the chromatic aberration effect (also known as color fringe) in the post-processing pipeline of Unreal Engine’s rendering system.

This setting variable is primarily used in the rendering system, specifically in the post-processing stage. It’s part of the Engine module, as evidenced by its location in the SceneView.cpp file within the Engine source directory.

The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with a default value of -1.0f. This means that by default, there’s no clamping of the color fringe effect.

The associated variable CVarSceneColorFringeMax interacts directly with r.SceneColorFringe.Max. They share the same value and are used interchangeably in the code.

Developers must be aware that:

  1. The value -1.0f means no clamping is applied to the color fringe effect.
  2. A value of -2.0f is used to test extreme fringe effects.
  3. Any positive value will clamp the SceneFringeIntensity to that maximum value.

Best practices when using this variable include:

  1. Use it to fine-tune the visual quality and performance balance of your game.
  2. Be cautious when setting extreme values as it may affect the visual quality significantly.
  3. Consider the target hardware when adjusting this value, as it can impact performance on lower-end devices.

Regarding the associated variable CVarSceneColorFringeMax:

The best practice when using CVarSceneColorFringeMax is to modify it through the console or configuration files rather than hardcoding changes, allowing for easier tweaking and debugging during development.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:261

Scope: file

Source code excerpt:


static TAutoConsoleVariable<float> CVarSceneColorFringeMax(
	TEXT("r.SceneColorFringe.Max"),
	-1.0f,
	TEXT("Allows to clamp the postprocess setting (in percent, Scene chromatic aberration / color fringe to simulate an artifact that happens in real-world lens, mostly visible in the image corners)\n")
	TEXT("-1: don't clamp (default)\n")
	TEXT("-2: to test extreme fringe"),
	ECVF_Scalability | ECVF_RenderThreadSafe);

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:260

Scope: file

Source code excerpt:

	ECVF_Scalability | ECVF_RenderThreadSafe);

static TAutoConsoleVariable<float> CVarSceneColorFringeMax(
	TEXT("r.SceneColorFringe.Max"),
	-1.0f,
	TEXT("Allows to clamp the postprocess setting (in percent, Scene chromatic aberration / color fringe to simulate an artifact that happens in real-world lens, mostly visible in the image corners)\n")
	TEXT("-1: don't clamp (default)\n")
	TEXT("-2: to test extreme fringe"),
	ECVF_Scalability | ECVF_RenderThreadSafe);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:2254

Scope (from outer to inner):

file
function     void FSceneView::EndFinalPostprocessSettings

Source code excerpt:


	{
		float Value = CVarSceneColorFringeMax.GetValueOnGameThread();

		if (Value >= 0.0f)
		{
			FinalPostProcessSettings.SceneFringeIntensity = FMath::Min(FinalPostProcessSettings.SceneFringeIntensity, Value);
		}
		else if (Value == -2.0f)