r.LocalFogVolume.TileMaxInstanceCount

r.LocalFogVolume.TileMaxInstanceCount

#Overview

name: r.LocalFogVolume.TileMaxInstanceCount

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.TileMaxInstanceCount is to control the maximum number of local fog volumes that can be processed per view and per tile in the rendering system. This setting is part of Unreal Engine’s volumetric fog rendering subsystem.

This setting variable is primarily used in the Renderer module of Unreal Engine, specifically in the local fog volume rendering system. It’s referenced in the LocalFogVolumeRendering.cpp file, which suggests it’s a core part of the fog volume rendering pipeline.

The value of this variable is set through a console variable (CVar) system, allowing it to be adjusted at runtime. It’s initialized with a default value of 32 but can be changed through console commands or configuration files.

The associated variable CVarLocalFogVolumeTileMaxInstanceCount directly interacts with r.LocalFogVolume.TileMaxInstanceCount. They share the same value and purpose.

Developers must be aware of the following when using this variable:

  1. It has a significant impact on rendering performance and visual quality of fog effects.
  2. The value is clamped between 1 and 256, as indicated by the GetLocalFogVolumeTileMaxInstanceCount function.
  3. This setting affects the consistency of fog rendering across tiles in the view.

Best practices when using this variable include:

  1. Adjusting it based on the specific needs of your scene and target hardware capabilities.
  2. Monitoring performance impacts when changing this value, especially on lower-end hardware.
  3. Consider the trade-off between visual quality (higher values) and performance (lower values).

Regarding the associated variable CVarLocalFogVolumeTileMaxInstanceCount:

When working with this variable, developers should use the CVarLocalFogVolumeTileMaxInstanceCount.GetValueOnRenderThread() method to access its current value, ensuring thread-safe access in render-related code.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLocalFogVolumeTileMaxInstanceCount(
	TEXT("r.LocalFogVolume.TileMaxInstanceCount"), 32,
	TEXT("Maximum number of local fog volume to account for per view (and per tile or consistency)."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarLocalFogVolumeTileCullingUseAsync(
	TEXT("r.LocalFogVolume.TileCullingUseAsync"), 1,
	TEXT("True if we want to try and use culling on the async pipe."),

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarLocalFogVolumeTileMaxInstanceCount(
	TEXT("r.LocalFogVolume.TileMaxInstanceCount"), 32,
	TEXT("Maximum number of local fog volume to account for per view (and per tile or consistency)."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarLocalFogVolumeTileCullingUseAsync(
	TEXT("r.LocalFogVolume.TileCullingUseAsync"), 1,

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

Scope (from outer to inner):

file
function     static uint32 GetLocalFogVolumeTileMaxInstanceCount

Source code excerpt:

{
	// We do not allow more than 256 instances since culled indices might be stored a u8 values.
	return FMath::Max(1u, FMath::Min(256u, (uint32)CVarLocalFogVolumeTileMaxInstanceCount.GetValueOnRenderThread()));
}

bool ProjectSupportsLocalFogVolumes()
{
	return CVarSupportLocalFogVolumes.GetValueOnRenderThread() > 0;
}