r.LocalFogVolume.RenderDuringHeightFogPass

r.LocalFogVolume.RenderDuringHeightFogPass

#Overview

name: r.LocalFogVolume.RenderDuringHeightFogPass

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.LocalFogVolume.RenderDuringHeightFogPass is to control the rendering process of Local Fog Volumes in Unreal Engine 5. Specifically, it determines whether Local Fog Volumes should be rendered during the height fog pass, bypassing the tiled rendering pass typically used for them.

This setting variable is primarily used by the rendering system, particularly in the Local Fog Volume rendering subsystem of Unreal Engine 5. Based on the callsites, it’s clear that this variable is part of the Renderer module, as evidenced by its location in the LocalFogVolumeRendering.cpp file.

The value of this variable is set using a console variable (CVar) system. It’s initialized with a default value of 0, meaning that by default, Local Fog Volumes are not rendered during the height fog pass.

This variable interacts closely with other fog-related variables, particularly CVarLocalFogVolumeRenderIntoVolumetricFog, which controls whether Local Fog Volumes are voxelized into volumetric fog.

Developers should be aware that this feature is experimental and only works on non-mobile rendering paths. It’s important to note that enabling this option will change the rendering pipeline for Local Fog Volumes, which could have performance and visual implications.

Best practices when using this variable include:

  1. Testing thoroughly on target platforms to ensure desired performance and visual results.
  2. Using in conjunction with other fog-related settings for optimal results.
  3. Being cautious when enabling in production builds due to its experimental nature.

Regarding the associated variable CVarLocalFogVolumeRenderDuringHeightFogPass:

This is the actual console variable that stores the value of r.LocalFogVolume.RenderDuringHeightFogPass. It’s used internally by the engine to query the current setting value, as seen in the ShouldRenderLocalFogVolumeDuringHeightFogPass function.

The purpose of this variable is the same as r.LocalFogVolume.RenderDuringHeightFogPass - to control whether Local Fog Volumes are rendered during the height fog pass.

It’s part of the Renderer module and is used in the Local Fog Volume rendering system.

The value is set through the console variable system and can be changed at runtime.

This variable directly interacts with the rendering logic, influencing how Local Fog Volumes are processed in the rendering pipeline.

Developers should be aware that changes to this variable will immediately affect the rendering of Local Fog Volumes, potentially impacting performance and visual quality.

Best practices include using engine-provided functions like GetValueOnRenderThread() to safely access the value, especially in render thread operations.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LocalFogVolumeRendering.cpp:23

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLocalFogVolumeRenderDuringHeightFogPass(
	TEXT("r.LocalFogVolume.RenderDuringHeightFogPass"), 0,
	TEXT("LocalFogVolume are going to be rendered during the height fog pass, skipping the tiled rendering pass specific to them. Only work on the non mobile path as an experiment."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarLocalFogVolumeRenderIntoVolumetricFog(
	TEXT("r.LocalFogVolume.RenderIntoVolumetricFog"), 1,
	TEXT("LocalFogVolume are going to be voxelised into the volumetric fog when this is not 0, otherwise it will remain isolated."),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LocalFogVolumeRendering.cpp:22

Scope: file

Source code excerpt:

	ECVF_ReadOnly | ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarLocalFogVolumeRenderDuringHeightFogPass(
	TEXT("r.LocalFogVolume.RenderDuringHeightFogPass"), 0,
	TEXT("LocalFogVolume are going to be rendered during the height fog pass, skipping the tiled rendering pass specific to them. Only work on the non mobile path as an experiment."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarLocalFogVolumeRenderIntoVolumetricFog(
	TEXT("r.LocalFogVolume.RenderIntoVolumetricFog"), 1,

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LocalFogVolumeRendering.cpp:121

Scope (from outer to inner):

file
function     bool ShouldRenderLocalFogVolumeDuringHeightFogPass

Source code excerpt:

	if (ShouldRenderLocalFogVolume(Scene, SceneViewFamily))
	{
		return CVarLocalFogVolumeRenderDuringHeightFogPass.GetValueOnRenderThread() > 0;
	}
	return false;
}

bool ShouldRenderLocalFogVolumeInVolumetricFog(const FScene* Scene, const FSceneViewFamily& SceneViewFamily, bool bShouldRenderVolumetricFog)
{