r.SceneCulling.Async.Update

r.SceneCulling.Async.Update

#Overview

name: r.SceneCulling.Async.Update

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.Async.Update is to enable or disable asynchronous culling scene updates in the rendering system of Unreal Engine 5.

This setting variable is primarily used by the Renderer module, specifically in the scene culling subsystem. It is part of the optimization techniques used to improve rendering performance by determining which objects should be rendered in a given frame.

The value of this variable is set through a console variable (CVarSceneCullingAsyncUpdate) in the Unreal Engine’s configuration system. It is initialized with a default value of 1, meaning asynchronous culling scene updates are enabled by default.

The associated variable CVarSceneCullingAsyncUpdate directly interacts with r.SceneCulling.Async.Update. They share the same value and purpose.

Developers must be aware that this variable affects the rendering performance and behavior. Enabling asynchronous updates (value = 1) can potentially improve performance by allowing culling operations to be performed in parallel with other rendering tasks. However, it may also introduce some latency in scene updates.

Best practices when using this variable include:

  1. Testing the performance impact with both enabled and disabled states in your specific use case.
  2. Considering the trade-off between potential performance gains and update latency.
  3. Monitoring for any visual artifacts that might occur due to asynchronous updates.

Regarding the associated variable CVarSceneCullingAsyncUpdate:

When working with this variable, developers should consider its impact on the overall rendering pipeline and test thoroughly in various scenarios to ensure optimal performance and visual quality.

#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:122

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarSceneCullingAsyncUpdate(
	TEXT("r.SceneCulling.Async.Update"), 
	1, 
	TEXT("Enable/Disable async culling scene update."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarSceneCullingAsyncQuery(
	TEXT("r.SceneCulling.Async.Query"), 

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe | ECVF_ReadOnly);

static TAutoConsoleVariable<int32> CVarSceneCullingAsyncUpdate(
	TEXT("r.SceneCulling.Async.Update"), 
	1, 
	TEXT("Enable/Disable async culling scene update."),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarSceneCullingAsyncQuery(

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

Scope (from outer to inner):

file
function     FSceneCulling::FUpdater &FSceneCulling::BeginUpdate

Source code excerpt:


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

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