Version

menu_open
Warning: you were redirected to the latest documentation corresponding to your major release ( 2023.1.9.8628 ). Should you wish to access your specific version's documentation, please download the offline documentation from the Audiokinetic Launcher and check the Offline Documentation option in Wwise Authoring.
Wwise SDK 2023.1.9
Obstruction and Occlusion with Game-defined Auxiliary Sends

In games, it is common for a game object to be either partially blocked (obstructed) by another object such as a wall or beam, or completely blocked (occluded) in a room where the listener can only hear a few sounds that pass through the walls. You can use auxiliary sends to represent the reflections of the signal.

Wwise does not compute obstruction and occlusion levels by itself. The game must perform the physics calculations and pass the results to the sound engine with AK::SoundEngine::SetObjectObstructionAndOcclusion().

The Wwise sound engine maps the obstruction and occlusion levels to a set of volume, low-pass filter, and high-pass filter curves that you define in Wwise. By default, these curves are project-wide, but you can use Attenuation ShareSets to customize them for different sounds. These curves are then applied to sound objects as they are influenced by obstruction and occlusion during gameplay. The values you define are relative, and are added to any volume and LPF/HPF values already applied to the game object.

In the implementation of these conditions, the sound engine calculates percentage values and assigns them to both obstruction and occlusion to enhance realism. These percentages are based on real-time positioning information from the game engine and can reflect a game object's movement in and out of a blocked area. For example, a spy character might move through an art gallery full of large sculptures. The percentage of obstruction could change depending on where the spy is as they pass behind each sculpture. Similarly, the percentage of occlusion could shift as the spy slowly sneaks out of a completely occluded broom closet.

It is possible to use obstruction and occlusion in combination with Spatial Audio, or independently. For more information about Spatial Audio, see Spatial Audio.

Here is a diagram of the obstruction/occlusion processing pipeline inside the sound engine:

Obstruction/Occlusion Processing Pipeline

Understanding Obstruction

Obstruction occurs when an object in the game, such as a wall or pillar, partially blocks the space between a sound source and a listener. For example, in a spy game, player characters hiding behind a pillar could still hear gunshots in front of them.

Example of an Obstruction

Obstruction can be modeled by applying a volume control, Low Pass Filter (LPF), High Pass Filter (HPF), or a combination of the three to the direct path of the signal. The auxiliary send reflections are unaffected.

Understanding Occlusion

Occlusion occurs when an object in the game geometry completely blocks the space between a sound source and its listener. For example, in a spy game, a player character might hear gunshots in the next room, even though there is a wall between the character and the discharged firearm.

Example of an Occlusion

Occlusion can be modeled by applying a volume control, Low Pass Filter (LPF), High Pass Filter (HPF), or a combination of the three that affects both the direct path and the auxiliary send reflections of the signal. Obstruction and occlusion can happen simultaneously. The direct path is affected by both the obstruction and occlusion values. However, the reflection path is affected by the occlusion value only.

Setting Obstruction and Occlusion

The game engine determines the obstruction and occlusion values from the position of the objects and listeners in the game's geometry.

Sound designers can set curves in Wwise Authoring to determine how the volume, LPF, and HPF react to calculated obstruction and occlusion values. They can also enable or disable any curve to best suit their performance and realism needs.

By default, all sounds use the curves specified in the Wwise project. For more information, see Defining Obstruction and Occlusion Curves for Your Project.

In the following example, an obstruction value of 1.0f (100%) produces a volume change of -50 dB on the source object. Obstruction and Occlusion levels must always be a value between 0.0f and 1.0f.

Customizing the Project Obstruction and Occlusion Curves in Wwise

You can also use Attenuation ShareSets to enable, disable, and set obstruction and occlusion for separate sounds. For more information, see Applying Attenuation.

Game designers must calculate the obstruction and occlusion for each game object that affects each listener and pass the values to the sound engine with the AK::SoundEngine::SetObjectObstructionAndOcclusion() call.

When multiple listeners are enabled for a game object, the sound engine determines the minimum LPF value and maximum volume value that all listeners can hear. It then uses those values to compute the resulting obstruction/occlusion.

Example: Setting Obstruction and Occlusion

#define MAIN_LISTENER 0
// game loop
while( TRUE )
{
(...)
for( int iGameObject = 0; iGameObject < nbObjects; iGameObject++ )
{
AkReal32 fCalculatedObs, fCalculatedOcc;
pGeometryModule->GetObsAndOccForGameObject( iGameObject, MAIN_LISTENER, &fCalculatedObs, &fCalculatedOcc );
AK::SoundEngine::SetObjectObstructionAndOcclusion( iGameObject, MAIN_LISTENER, fCalculatedObs, fCalculatedOcc );
}
(...)
}

Additional Resources

See also
float AkReal32
32-bit floating point
AKSOUNDENGINE_API AKRESULT SetObjectObstructionAndOcclusion(AkGameObjectID in_EmitterID, AkGameObjectID in_ListenerID, AkReal32 in_fObstructionLevel, AkReal32 in_fOcclusionLevel)

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise