Version

menu_open
Wwise SDK 2021.1.14
Using the Geometry API for Simulating Early Reflections

Introduction

The Geometry API uses emitter and listener positions, and triangles of your game's (typically simplified) geometry in order to compute image sources for simulating dynamic early reflections, in conjunction with the Wwise Reflect plug-in. Sound designers control translation of image source positions directly in Wwise Reflect, per tweaking of properties based on distance and materials.

Please refer to our Image Source Approach to Dynamic Early Reflections and Creating compelling reverberations for virtual reality blogs, for example, for an introduction to geometry-driven early reflections (ER for short).

Note: The reflection order refers to the number of surfaces hit by a wavefront before reaching the listener. For example, in a shoebox-shaped room with six surfaces, simulating first order reflections means that there will be six times one early reflections, also known as image sources, per emitter. This results in a total of six reflections. Simulating second order reflections means that there will be six first order reflections, plus six times five, accounting for the other walls, second order reflections. This results in a total of 36 reflections per emitter. The number of reflections grows exponentially with the order.

Wwise Spatial Audio currently supports simulating up to fourth order reflections. The reflection order is set globally, with the AkSpatialAudioInitSettings::uMaxReflectionOrder init setting. It can also be changed dynamically with AK::SpatialAudio::SetReflectionsOrder.

Wwise project setup

For each sound that should support dynamic early reflections, make sure an early reflections bus is assigned under the General Settings tab in the Wwise Authoring Tool to indicate the Auxiliary Bus that hosts the desired Wwise Reflect plug-in. Spatial Audio will establish a special aux send connection to this bus. You may also set a send volume.

Typically for environmental reverbs, the Auxiliary Bus is created on the listener game object allowing multiple emitters to share the same bus and effect instance. While still true for rooms used for late reverb by Spatial Audio, this is not the case for early reflections, because each emitter has its own set of reflections that depend on the unique position of the emitter. Instead, the ER bus instance is created on the emitter game object, and different emitters will send to different instances of the Auxiliary Bus. This is illustrated in the screenshot of the Voices Graph in 'Wwise project setup', seen below.

You need to understand the following aspects of the bus structure design for handling dynamic environmental effects in your Wwise project effectively.

Attenuation Design

There is an important thing to be aware of when designing attenuation curves on sounds that are used with Spatial Audio in order to ensure efficient computation. Sounds that are assigned an early reflections Auxiliary Bus and those that are marked with Enable Diffraction and Transmission in the Authoring tool must be assigned an attenuation with finite radius to limit the computation of paths.

Spatial Audio uses the attenuation of a sound to determine the maximum possible propagation distance for both reflection and diffraction path calculations, so it is important to make sure the maximum attenuation distance is a representative value. Futhermore, if the attenuation does not go below the platform's specified volume threshold, then the sound's radius is effectively infinite. In this case, Spatial Audio will attempt to calculate reflections and diffractions regardless of where the listener is placed in the world. Both the 'Output Bus volume' and the 'Auxiliary send volume' curves must have their final point on the far right side of the curve below the volume threshold to ensure that Spatial Audio calculations are limited to a finite radius around the emitter Game Object. Note that the volume threshold is defined in the project settings dialog, which can be found in the Project menu in the Authoring Tool.

Note: If a Game Object has multiple active sounds playing, each with different assigned attenuations, the largest of all attenuation radii is used to limit path processing. Path processing is only ever performed once per Game Object, the paths are then reused amongst multiple sounds if necessary.

Auxiliary bus design

Typically, different Auxiliary Busses are used to represent different environments, and these busses may host different reverb ShareSets that emulate the reverberating characteristics of these environments. When using dynamic ER, such as those processed by Wwise Reflect under Spatial Audio, late reverberation may still be designed using reverbs on Auxiliary Busses. However, you may want to disable the ER section of these reverbs (if applicable), as this should be taken care of by Wwise Reflect.

On the other hand, Wwise Reflect should run in parallel with the aux busses used for the late reverberation. The figure below shows a typical bus structure, where the three Auxiliary Busses under the EarlyReflections bus each contain a different ShareSet of Wwise Reflect. You will note that in this design, we only use a handful of ShareSets for generating early reflections. This is motivated by the fact that the "spatial aspect" of this Effect is driven by the game geometry at run-time. We only use different ShareSets here because we want different attenuation curves for sounds emitted by the player (listener) than those emitted by other objects.

Bus instances

The ER bus (hosting Wwise Reflect) will exist in as many instances as there are game objects currently playing sounds with an assigned ER bus. This is important because the location of image sources depends on the emitter's position. To correctly set up the routing of the ER bus, you need to enable the Listener Relative Routing check box, as shown in the image below. By doing this, the signal generated by the various instances of the ER bus will be properly mixed into a single instance of the next mixing bus downstream. This single instance corresponds to the game object that is listening to this emitter (set via AK::SoundEngine::SetListeners), which is typically the final listener, that corresponds to the player (or camera).

If different sounds playing on the same game object are assigned different early reflections aux busses, then multiple instances of the bus will be created on the same emitter game object. The reflection calculations that are performed by Spatial Audio will still only be done once per game object, however the results will be sent to the two unique instances of the Wwise Reflect plug-in. By doing so, users can customize reflections curves per-sound by using different share sets of the plug-in.

Warning: Although the ER bus's Listener Relative Routing must be enabled in order to ensure that all its emitter-instances merge into the listener's busses, the 3D Spatialization mode must be set to None, to avoid "double 3D spatialization" by Wwise. Likewise, you should not use attenuation, unless you want additional attenuation to be applied on top of the image-source curves in Wwise Reflect.

Early reflections sending to late reverberation

Also, by virtue of the game object (emitter) sending to the Auxiliary Bus used to process the late reverberation, a connection will also be made between the ER bus and the late reverb bus. This is usually desirable because the generated ER are then utilized to color and "densify" the late reverb. In order to enable this, you need to make sure you enable the Use game-defined auxiliary sends check box on the ER bus. You may then use the Volume slider below to balance the amount of early reflections you want to send to the late reverb against the direct sound.

The following figure is a run-time illustration of the previous discussion. Notice the following:

  • Weapon Fire SW is routed to FirstPerson (early reflections) bus because of the Early Reflection send
  • The FirstPerson bus is in the scope of FirstPersonCharacter game object. Another game object would thus send to a different instance of the FirstPerson bus, as desired.
  • There is a send connection from FirstPerson bus to Mezzanine2 aux bus because Use game-defined auxiliary sends is enabled.
  • FirstPerson's output bus Binaural is in the listener's scope, that is, PlayerCameraManager, because the Listener Relative Routing option is enabled on the FirstPerson bus. All early reflection bus instances should have this option enabled, such that they all return to the single Binaural bus instance of the listener. If you fail to do so, a separate instance of Binaural bus would erroneously be instantiated on the emitter game object.
  • There is no attenuation between FirstPerson and Binaural busses due to distance, as ER attenuation is already designed and applied within Wwise Reflect.

Using Acoustic Textures

For each reflecting triangle, the game passes the ID of a material. These materials are edited in the Wwise Project in the form of Acoustic Textures, in the Virtual Acoustics ShareSets. This is where you may define the absorption characteristics of each material.


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