r.SceneCulling.SmallFootprintSideThreshold

r.SceneCulling.SmallFootprintSideThreshold

#Overview

name: r.SceneCulling.SmallFootprintSideThreshold

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.SceneCulling.SmallFootprintSideThreshold is to define a threshold for scene culling operations in the rendering system of Unreal Engine 5. It determines when to use a footprint-based path for culling queries based on the size of the query’s footprint.

This setting variable is primarily used by the Renderer module, specifically within the scene culling subsystem. It’s part of the optimization process for rendering scenes efficiently.

The value of this variable is set through a console variable (CVar) named CVarSmallFootprintSideThreshold. It’s initialized with a default value of 16, which corresponds to a footprint of 16x16x16 cells or 8 blocks.

The associated variable CVarSmallFootprintSideThreshold directly interacts with r.SceneCulling.SmallFootprintSideThreshold. They share the same value and purpose.

Developers should be aware that this variable affects the performance of scene culling operations. Changing its value can impact the balance between using the footprint-based path and other culling methods.

Best practices when using this variable include:

  1. Understanding the impact on performance before modifying the default value.
  2. Testing different values in various scenarios to find the optimal setting for specific game environments.
  3. Considering the scale and complexity of your game’s scenes when adjusting this value.

Regarding the associated variable CVarSmallFootprintSideThreshold:

Its purpose is to provide a programmatic way to access and modify the r.SceneCulling.SmallFootprintSideThreshold value within the C++ code.

It’s used in the Renderer module, specifically in the SceneCulling.cpp file.

The value is set when the CVar is initialized and can be accessed or modified at runtime using the GetValueOnRenderThread() method.

This variable directly interacts with r.SceneCulling.SmallFootprintSideThreshold, effectively controlling its value.

Developers should be aware that changes to this variable will affect scene culling behavior and potentially impact rendering performance.

Best practices include using this variable to dynamically adjust the culling threshold based on runtime conditions or performance requirements, and ensuring that any modifications are thread-safe, as indicated by the ECVF_RenderThreadSafe flag.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneCulling/SceneCulling.cpp:156

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarSmallFootprintSideThreshold(
	TEXT("r.SceneCulling.SmallFootprintSideThreshold"), 
	16, 
	TEXT("Queries with a smaller footprint (maximum) side (in number of cells in the lowest level) go down the footprint based path.\n") 
	TEXT("  The default (16) <=> a footprint of 16x16x16 cells or 8 blocks"), 
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarValidateAllInstanceAllocations(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneCulling/SceneCulling.cpp:155

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarSmallFootprintSideThreshold(
	TEXT("r.SceneCulling.SmallFootprintSideThreshold"), 
	16, 
	TEXT("Queries with a smaller footprint (maximum) side (in number of cells in the lowest level) go down the footprint based path.\n") 
	TEXT("  The default (16) <=> a footprint of 16x16x16 cells or 8 blocks"), 
	ECVF_RenderThreadSafe);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneCulling/SceneCulling.cpp:2671

Scope (from outer to inner):

file
function     FSceneCulling::FUpdater &FSceneCulling::BeginUpdate

Source code excerpt:

	bUseExplictBounds = CVarSceneCullingUseExplicitCellBounds.GetValueOnRenderThread() != 0;

	SmallFootprintCellSideThreshold = CVarSmallFootprintSideThreshold.GetValueOnRenderThread();
	bUseAsyncUpdate = CVarSceneCullingAsyncUpdate.GetValueOnRenderThread() != 0;
	bUseAsyncQuery = CVarSceneCullingAsyncQuery.GetValueOnRenderThread() != 0;

	if (bIsEnabled)
	{
		Updater.Implementation = new FSceneCullingBuilder(*this, bAnySceneUpdatesExpected);