r.AOScatterTileCulling
r.AOScatterTileCulling
#Overview
name: r.AOScatterTileCulling
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to use the rasterizer for binning occluder objects into screenspace tiles.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.AOScatterTileCulling is to control whether the rasterizer is used for binning occluder objects into screenspace tiles in the Ambient Occlusion (AO) system. This setting variable is part of the rendering system, specifically related to distance field object culling and ambient occlusion.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the distance field and ambient occlusion components. This is evident from the file location (DistanceFieldObjectCulling.cpp) and the context of the code.
The value of this variable is set through the console variable system. It’s initialized with a default value of 1 (enabled) and can be changed at runtime using console commands.
The associated variable GAOScatterTileCulling interacts directly with r.AOScatterTileCulling. They share the same value, with GAOScatterTileCulling being the actual integer variable used in the C++ code.
Developers must be aware that this variable affects the performance and potentially the visual quality of ambient occlusion. Enabling this feature (value set to 1) uses the rasterizer for binning occluder objects, which may have performance implications.
Best practices when using this variable include:
- Testing the performance impact with it enabled and disabled in various scenarios.
- Considering the trade-off between potential performance gains and any visual differences.
- Being cautious when changing this value at runtime, as it may affect rendering performance.
Regarding the associated variable GAOScatterTileCulling:
The purpose of GAOScatterTileCulling is to serve as the internal C++ representation of the r.AOScatterTileCulling console variable. It’s used directly in the code to check whether the scatter tile culling feature is enabled.
This variable is used in the Renderer module, specifically in the distance field object culling system.
The value of GAOScatterTileCulling is set automatically by the console variable system when r.AOScatterTileCulling is modified.
GAOScatterTileCulling interacts directly with r.AOScatterTileCulling, effectively mirroring its value.
Developers should be aware that modifying GAOScatterTileCulling directly in code is not recommended, as it may become out of sync with the console variable. Instead, they should use the console variable system to modify r.AOScatterTileCulling.
Best practices for GAOScatterTileCulling include:
- Using it for conditional logic in rendering code related to AO scatter tile culling.
- Avoiding direct modification of this variable in code.
- Relying on the console variable system for any runtime changes to this setting.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DistanceFieldObjectCulling.cpp:23
Scope: file
Source code excerpt:
int32 GAOScatterTileCulling = 1;
FAutoConsoleVariableRef CVarAOScatterTileCulling(
TEXT("r.AOScatterTileCulling"),
GAOScatterTileCulling,
TEXT("Whether to use the rasterizer for binning occluder objects into screenspace tiles."),
ECVF_RenderThreadSafe
);
int32 GAverageDistanceFieldObjectsPerCullTile = 512;
#Associated Variable and Callsites
This variable is associated with another variable named GAOScatterTileCulling
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DistanceFieldObjectCulling.cpp:21
Scope: file
Source code excerpt:
#include "ShaderCompilerCore.h"
int32 GAOScatterTileCulling = 1;
FAutoConsoleVariableRef CVarAOScatterTileCulling(
TEXT("r.AOScatterTileCulling"),
GAOScatterTileCulling,
TEXT("Whether to use the rasterizer for binning occluder objects into screenspace tiles."),
ECVF_RenderThreadSafe
);
int32 GAverageDistanceFieldObjectsPerCullTile = 512;
FAutoConsoleVariableRef CVarMaxDistanceFieldObjectsPerCullTile(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DistanceFieldObjectCulling.cpp:354
Scope (from outer to inner):
file
function void BuildTileObjectLists
Source code excerpt:
const FDistanceFieldAOParameters& Parameters)
{
ensure(GAOScatterTileCulling);
RDG_EVENT_SCOPE(GraphBuilder, "BuildTileList");
RDG_GPU_MASK_SCOPE(GraphBuilder, View.GPUMask);
const FIntPoint TileListGroupSize = GetTileListGroupSizeForView(View);