r.LocalFogVolume.TilePixelSize

r.LocalFogVolume.TilePixelSize

#Overview

name: r.LocalFogVolume.TilePixelSize

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.TilePixelSize is to control the tile size on screen in pixels at which local fog volumes are culled. This setting is part of the rendering system, specifically for optimizing the rendering of local fog volumes.

This setting variable is primarily used in the Renderer module of Unreal Engine, specifically in the local fog volume rendering subsystem. It’s defined and used in the LocalFogVolumeRendering.cpp file.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 128 pixels, but can be changed at runtime through console commands or programmatically.

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

Developers must be aware that this variable affects the culling of local fog volumes. A larger value will result in larger tiles, potentially reducing the number of fog volumes rendered but possibly at the cost of visual accuracy. A smaller value will create smaller tiles, potentially increasing rendering accuracy but at the cost of performance.

Best practices when using this variable include:

  1. Balancing between performance and visual quality. Start with the default value and adjust as needed.
  2. Testing different values in various scenarios to find the optimal setting for your specific game or application.
  3. Being mindful of the performance impact on different hardware configurations.

Regarding the associated variable CVarLocalFogVolumeTilePixelSize:

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLocalFogVolumeTilePixelSize(
	TEXT("r.LocalFogVolume.TilePixelSize"), 128,
	TEXT("Tile size on screen in pixel at which we cull the local fog volumes."),
	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)."),

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_ReadOnly | ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarLocalFogVolumeTilePixelSize(
	TEXT("r.LocalFogVolume.TilePixelSize"), 128,
	TEXT("Tile size on screen in pixel at which we cull the local fog volumes."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarLocalFogVolumeTileMaxInstanceCount(
	TEXT("r.LocalFogVolume.TileMaxInstanceCount"), 32,

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

Scope (from outer to inner):

file
function     static uint32 GetLocalFogVolumeTilePixelSize

Source code excerpt:

static uint32 GetLocalFogVolumeTilePixelSize()
{
	return FMath::Max(8u, FMath::Min(512u, (uint32)CVarLocalFogVolumeTilePixelSize.GetValueOnRenderThread()));
}

static bool GetLocalFogVolumeTileCullingUseAsync()
{
	return GSupportsEfficientAsyncCompute && CVarLocalFogVolumeTileCullingUseAsync.GetValueOnRenderThread() > 0;
}