r.VolumetricCloud.HighQualityAerialPerspective

r.VolumetricCloud.HighQualityAerialPerspective

#Overview

name: r.VolumetricCloud.HighQualityAerialPerspective

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.VolumetricCloud.HighQualityAerialPerspective is to enable or disable a second pass for tracing aerial perspective per pixel on clouds, instead of using the aerial perspective texture. This setting is part of the volumetric cloud rendering system in Unreal Engine 5.

This setting variable is primarily used by the Renderer subsystem, specifically within the volumetric cloud rendering module. It’s referenced in the VolumetricCloudRendering.cpp file, which is responsible for handling the rendering of volumetric clouds in the engine.

The value of this variable is set through a console variable (CVarVolumetricCloudHighQualityAerialPerspective) with a default value of 0 (disabled). It can be changed at runtime using console commands or through engine configuration files.

This variable interacts with other volumetric cloud rendering settings, particularly r.VolumetricCloud.EnableAerialPerspectiveSampling and r.VolumetricRenderTarget. It’s only usable when r.VolumetricCloud.EnableAerialPerspectiveSampling is set to 1, and it’s primarily needed for extra quality when r.VolumetricRenderTarget is set to 1.

Developers should be aware that enabling this setting may have performance implications, as it introduces an additional rendering pass. It should be used judiciously, particularly in performance-sensitive scenarios.

Best practices for using this variable include:

  1. Only enable it when high-quality cloud rendering is necessary, as it can impact performance.
  2. Ensure that r.VolumetricCloud.EnableAerialPerspectiveSampling is set to 1 before enabling this setting.
  3. Consider the target hardware and performance requirements when deciding to use this setting.
  4. Test the visual impact and performance implications thoroughly before enabling it in production builds.

The associated variable CVarVolumetricCloudHighQualityAerialPerspective is the actual console variable that controls this setting. It’s defined as an integer with the same name as the r.VolumetricCloud.HighQualityAerialPerspective setting. This variable is used internally by the engine to check the current state of the setting and apply the appropriate rendering techniques.

When using CVarVolumetricCloudHighQualityAerialPerspective, developers should:

  1. Access its value using GetValueOnAnyThread() method when needed in rendering code.
  2. Be aware that it’s marked as render thread safe and scalable, meaning it can be adjusted based on the current scalability settings.
  3. Consider exposing this setting in user-facing graphics options if fine-grained control over cloud rendering quality is desired.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:65

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarVolumetricCloudHighQualityAerialPerspective(
	TEXT("r.VolumetricCloud.HighQualityAerialPerspective"), 0,
	TEXT("Enable/disable a second pass to trace the aerial perspective per pixel on clouds instead of using the aerial persepctive texture. Only usable when r.VolumetricCloud.EnableAerialPerspectiveSampling=1 and only needed for extra quality when r.VolumetricRenderTarget=1."),
	ECVF_RenderThreadSafe | ECVF_Scalability);

static TAutoConsoleVariable<int32> CVarVolumetricCloudDisableCompute(
	TEXT("r.VolumetricCloud.DisableCompute"), 0,
	TEXT("Do not use compute shader for cloud tracing."),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:64

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe | ECVF_Scalability);

static TAutoConsoleVariable<int32> CVarVolumetricCloudHighQualityAerialPerspective(
	TEXT("r.VolumetricCloud.HighQualityAerialPerspective"), 0,
	TEXT("Enable/disable a second pass to trace the aerial perspective per pixel on clouds instead of using the aerial persepctive texture. Only usable when r.VolumetricCloud.EnableAerialPerspectiveSampling=1 and only needed for extra quality when r.VolumetricRenderTarget=1."),
	ECVF_RenderThreadSafe | ECVF_Scalability);

static TAutoConsoleVariable<int32> CVarVolumetricCloudDisableCompute(
	TEXT("r.VolumetricCloud.DisableCompute"), 0,

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:2568

Scope (from outer to inner):

file
function     bool FSceneRenderer::RenderVolumetricCloud

Source code excerpt:

					bEnableAerialPerspectiveSampling
					&& Scene->HasSkyAtmosphere()
					&& CVarVolumetricCloudHighQualityAerialPerspective.GetValueOnAnyThread() > 0
					&& !ViewInfo.bIsReflectionCapture
					&& !bCloudDebugViewModeEnabled;

				if (bAsyncCompute
					&& bShouldViewRenderVolumetricCloudRenderTarget
					&& !bShouldUseHighQualityAerialPerspective