r.Lumen.Ortho.LumenSceneMinCardResolution

r.Lumen.Ortho.LumenSceneMinCardResolution

#Overview

name: r.Lumen.Ortho.LumenSceneMinCardResolution

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.Lumen.Ortho.LumenSceneMinCardResolution is to control the minimum card resolution for the Lumen Scene when an orthographic view is present in the rendering system.

This setting variable is primarily used by the Lumen subsystem within Unreal Engine’s rendering module. Specifically, it’s utilized in the LumenSceneGPUDrivenUpdate.cpp file, which is part of the Lumen global illumination system.

The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with an initial value of 1.

This variable interacts with the standard MinCardResolution setting. When an orthographic view is present and this variable is set to a value greater than 0, it overrides the standard MinCardResolution for the Lumen Scene.

Developers must be aware that this setting only takes effect when dealing with orthographic views. It’s designed to provide finer control over the Lumen Scene’s surface cache resolution in these specific cases.

Best practices when using this variable include:

  1. Only modify it when you need to specifically adjust the Lumen Scene resolution for orthographic views.
  2. Be mindful of performance implications when increasing this value, as higher resolutions can impact rendering performance.
  3. Use in conjunction with other Lumen settings to achieve the desired balance between visual quality and performance.

Regarding the associated variable CVarOrthoLumenSceneMinCardResolution:

This is the actual console variable object that stores and manages the r.Lumen.Ortho.LumenSceneMinCardResolution setting. It’s defined as an integer variable with an initial value of 1.

The purpose of CVarOrthoLumenSceneMinCardResolution is to provide programmatic access to the r.Lumen.Ortho.LumenSceneMinCardResolution setting within the C++ code.

This variable is used in the LumenScene::GetCardMinResolution function to determine the minimum card resolution. If an orthographic camera is being used and CVarOrthoLumenSceneMinCardResolution is set to a value greater than 0, it returns this value as the minimum card resolution.

Developers should be aware that changes to CVarOrthoLumenSceneMinCardResolution will directly affect the behavior of the Lumen Scene when rendering orthographic views. It’s important to use GetValueOnRenderThread() when accessing this variable to ensure thread-safe operations.

Best practices for using CVarOrthoLumenSceneMinCardResolution include:

  1. Always check if the value is greater than 0 before applying it, as demonstrated in the provided code.
  2. Consider the performance implications of changing this value at runtime.
  3. Use in conjunction with other Lumen settings for optimal results.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:55

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarOrthoLumenSceneMinCardResolution(
	TEXT("r.Lumen.Ortho.LumenSceneMinCardResolution"),
	1,
	TEXT("If an orthographic view is present, forc the SurfaceCache MinCard to be set to OrthoMinCardResolution, otherwise use the standard MinCardResolution")
	TEXT("0 is disabled, higher values will force the resolution in Orthographic views"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:54

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarOrthoLumenSceneMinCardResolution(
	TEXT("r.Lumen.Ortho.LumenSceneMinCardResolution"),
	1,
	TEXT("If an orthographic view is present, forc the SurfaceCache MinCard to be set to OrthoMinCardResolution, otherwise use the standard MinCardResolution")
	TEXT("0 is disabled, higher values will force the resolution in Orthographic views"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:98

Scope (from outer to inner):

file
function     int32 LumenScene::GetCardMinResolution

Source code excerpt:

	if (bOrthographicCamera)
	{
		int32 OrthoMinCardResolution = CVarOrthoLumenSceneMinCardResolution.GetValueOnRenderThread();
		if(OrthoMinCardResolution > 0)
		{
			return OrthoMinCardResolution;
		}
	}
	return FMath::Clamp(CVarLumenSceneCardMinResolution.GetValueOnRenderThread(), 1, 1024);