au.AudioGameplayVolumes.PrimitiveProxy.DistanceCulling
au.AudioGameplayVolumes.PrimitiveProxy.DistanceCulling
#Overview
name: au.AudioGameplayVolumes.PrimitiveProxy.DistanceCulling
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Skips physics body queries for proxies that are not close to the listener.\n0: Disable, 1: Enable (default)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.AudioGameplayVolumes.PrimitiveProxy.DistanceCulling is to control distance culling for Audio Gameplay Volume proxies in Unreal Engine 5. This setting is used to optimize performance by skipping physics body queries for proxies that are not close to the listener.
This setting variable is primarily used by the Audio Gameplay Volume plugin, which is part of Unreal Engine’s audio system. Specifically, it is utilized in the AudioGameplayVolumeProxy module.
The value of this variable is set through the Unreal Engine console variable system. It is initialized with a default value of 1 (enabled) and can be changed at runtime using console commands.
The associated variable bProxyDistanceCulling directly interacts with au.AudioGameplayVolumes.PrimitiveProxy.DistanceCulling. They share the same value, with bProxyDistanceCulling being the actual boolean flag used in the code logic.
Developers must be aware that:
- This variable affects performance and audio behavior in games using Audio Gameplay Volumes.
- Disabling this feature (setting to 0) will cause physics body queries to be performed for all proxies, regardless of distance from the listener.
- Enabling this feature (setting to 1, which is the default) will optimize performance by culling distant proxies.
Best practices when using this variable include:
- Keep it enabled (set to 1) for better performance in most scenarios.
- Only disable it if you encounter specific issues related to audio behavior at a distance or if you need to debug Audio Gameplay Volume behavior.
- Consider the performance impact when changing this setting, especially in scenes with many Audio Gameplay Volumes.
Regarding the associated variable bProxyDistanceCulling:
- It is the actual boolean flag used in the code to implement the distance culling logic.
- It is used in the UAGVPrimitiveComponentProxy::NeedsPhysicsQuery function to determine whether a physics query is necessary for a given proxy.
- Developers should not modify this variable directly but instead use the console variable au.AudioGameplayVolumes.PrimitiveProxy.DistanceCulling to control its behavior.
- When bProxyDistanceCulling is 0, all proxies will undergo physics queries, potentially impacting performance.
- When bProxyDistanceCulling is 1 (default), the system will perform additional distance checks before deciding whether to execute physics queries, optimizing performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/AudioGameplayVolume/Source/AudioGameplayVolume/Private/AudioGameplayVolumeProxy.cpp:14
Scope (from outer to inner):
file
namespace AudioGameplayVolumeConsoleVariables
Source code excerpt:
int32 bProxyDistanceCulling = 1;
FAutoConsoleVariableRef CVarProxyDistanceCulling(
TEXT("au.AudioGameplayVolumes.PrimitiveProxy.DistanceCulling"),
bProxyDistanceCulling,
TEXT("Skips physics body queries for proxies that are not close to the listener.\n0: Disable, 1: Enable (default)"),
ECVF_Default);
} // namespace AudioGameplayVolumeConsoleVariables
#Associated Variable and Callsites
This variable is associated with another variable named bProxyDistanceCulling
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/AudioGameplayVolume/Source/AudioGameplayVolume/Private/AudioGameplayVolumeProxy.cpp:12
Scope (from outer to inner):
file
namespace AudioGameplayVolumeConsoleVariables
Source code excerpt:
namespace AudioGameplayVolumeConsoleVariables
{
int32 bProxyDistanceCulling = 1;
FAutoConsoleVariableRef CVarProxyDistanceCulling(
TEXT("au.AudioGameplayVolumes.PrimitiveProxy.DistanceCulling"),
bProxyDistanceCulling,
TEXT("Skips physics body queries for proxies that are not close to the listener.\n0: Disable, 1: Enable (default)"),
ECVF_Default);
} // namespace AudioGameplayVolumeConsoleVariables
#include UE_INLINE_GENERATED_CPP_BY_NAME(AudioGameplayVolumeProxy)
#Loc: <Workspace>/Engine/Plugins/AudioGameplayVolume/Source/AudioGameplayVolume/Private/AudioGameplayVolumeProxy.cpp:180
Scope (from outer to inner):
file
function bool UAGVPrimitiveComponentProxy::NeedsPhysicsQuery
Source code excerpt:
// Temporary kill switch for distance culling
if (AudioGameplayVolumeConsoleVariables::bProxyDistanceCulling == 0)
{
return true;
}
// Early distance culling
const float BoundsRadiusSq = FMath::Square(PrimitiveComponent->Bounds.SphereRadius);