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
Using Reverb Zones

A Reverb Zone models a region within a Room that has a distinct reverb effect but does not require portals to connect to neighboring Rooms. Use Reverb Zones instead of standard Rooms whenever there are no obvious walls, or generally when there is more negative space than positive space at the interface between the two regions. Here are some example scenarios where Reverb Zones can be used:

  • A covered balcony that connects to an outdoor space, which effectively creates a room with no walls, but with a floor and a ceiling.
  • A highway overpass. The area beneath the overpass requires a unique reverb, and a Reverb Zone is a more precise and straightforward solution than large portals that connect to the areas outside.
  • A forested area, where the forest reverb should be distinct from the surrounding environment, and might also have a unique ambience.
  • A small city or village area in a mountainous outdoor region.

A Reverb Zone is a type of Room within Wwise Spatial Audio, and has all the same properties of a Room. Additionally, a Reverb Zone:

  • Has a parent Room. A Reverb Zone's parent is the Room that contains the Reverb Zone. A parent room can also be a Reverb Zone with its own parent. Reverb Zones and their parents form hierarchies of rooms. It is recommended that a Reverb Zone be fully contained within its parent.
  • Has a transition region. The transition region is a fuzzy boundary at the interface of the Reverb Zone and its parent. The width of the transition region is customizable, and defined in game units. The transition region is comparable to a Portal connecting the Reverb Zone to its parent: it smooths the transition between the two Rooms and crossfades various parameters when a Game Object is inside the transition region.
  • Has a Geometry Set and Geometry Instance that define the size and shape of the Reverb Zone. For standard Rooms, defining geometry is optional. However, it is required for Reverb Zones so that Spatial Audio can calculate when an object transitions into and out of the Reverb Zone.
  • Has some unique considerations regarding attenuation. (Reverb Zones and Attenuation)

Sound Propagation Through Reverb Zones

There are different ways to manage sound propagation: you can add an extra send with AK::SoundEngine::SetGameObjectAuxSendValues or you can use Reverb Zones. However, Reverb Zones have an advantage: they integrate with and take full advantage of the sound propagation framework provided by the Rooms and Portals API in Wwise Spatial Audio.

  • Reverb Zones are Rooms, and are therefore rendered with a unique Game Object, and are spatialized in 3D.
  • Reverb Zones chain with other Rooms, including other Reverb Zones. A sound can propagate from one Room/Reverb Zone to another if the two Room are connected, either by a portal or if one Reverb Zone is the parent Room of the other.

The following example demonstrates Reverb Zone usage. It is included in the Integration Demo project, which is distributed as part of the Wwise SDK.

The emitter plays inside a Room called "Room Object"
The sound propagates ou of a Portal, which is connected to a Reverb Zone called "Patio Object".
The sound continues to propagate outside to the Reverb Zone's parent Room. When outside, the sound also diffracts around an obstacle defined by geometry.

You can see how the five Game Objects are chained together in the Voice Graph in either the Advanced Profiler or the Voice Inspector.

The emitter "Emitter E" sends to both the Room it is currently inside, and any adjacent Rooms. In this case, the emitter is inside "Room Object" and adjacent to "Patio Object".
Each Room sends to the next Room, following the shortest path towards the listener. "Room Object" sends to "Patio Object", which in turn sends to "Outside Object". The link between "Patio Object" and "Outside Object" is established by the parent-child relationship between the two Rooms.

Reverb Zone Transition Regions

You can use the AK::SpatialAudio::SetReverbZone API to specify a transition region between a Reverb Zone and its parent Room. This transition region functions very similarly to a portal. A transition region can overlap with portals and other transition regions as long as the Rooms' geometries do not overlap. You can use this type of overlap to create smooth crossfades between Reverb Zones. To define a transition region for a Reverb Zone, the Reverb Zone Room must have geometry with 1 or more "transparent" surfaces. A transparent surface is a surface with AkAcousticSurface::transmissionLoss set to 0. The extent of a Reverb Zone's transition region is defined by the location of the Room's transparent triangles, and the in_transitionRegionWidth parameter passed to AK::SpatialAudio::SetReverbZone. The transition region is centered around each triangle. Consider a Room with one wall composed of transparent surfaces, which we define as a Reverb Zone by calling AK::SpatialAudio::SetReverbZone with in_transitionRegionWidth set to 5. The transition region starts when a Game Object is 5 units away from the transparent wall on the outside of the Reverb Zone, and ends when the Game Object is 5 units past the wall on inside of the Reverb Zone. Because transition regions are only defined by transparent triangles, you can define a custom shape for the transition region. For more information about defining room geometry, refer to Setting up Room Geometry.

Creating Reverb Zones

This section describes the general Reverb Zone creation process. The following example demonstrates how to create a forest surrounded by an outdoor environment. The forest and the outdoor environment each have a unique reverb effect.

  1. Customize the "Outdoors" Room parameters. The "Outdoors" Room is created automatically, but you must call AK::SpatialAudio::SetRoom to assign a reverb bus to it.
    paramsRoom.TransmissionLoss = 0.f;
    paramsRoom.ReverbAuxBus = AK::SoundEngine::GetIDFromString("Outdoors_Reverb"); // Name of the auxiliary bus, defined in Wwise Authoring.
    paramsRoom.RoomPriority = 1; // We want "Outdoors" to have the lowest priority.
    AK::SpatialAudio::kOutdoorRoomID, // Outdoors has a special reserved ID
    paramsRoom,
    "Outdoors");
  2. Define a shape for the Reverb Zone. In this example, the shape is a simple box. The following sample code creates a Geometry Set that defines the surfaces and triangles, and a Geometry Instance that defines the scale and position of the forest.
    AkGeometryParams geometryParams;
    // Define a unit size box for the geometry set.
    // You can reuse this same box for multiple transparent rooms, if desired.
    AkVertex vertices[] = {
    { 0, 0, 0 },
    { 0, 1.f, 0 },
    { 1.f, 0, 0 },
    { 1.f, 1.f, 0 },
    { 1.f, 0, 1.f },
    { 1.f, 1.f, 1.f },
    { 0, 0, 1.f },
    { 0, 1.f, 1.f }
    };
    // Surface index IDs.
    // Set all to the single transparent surface.
    AkSurfIdx bottomWall = 0;
    AkSurfIdx rightWall = 0;
    AkSurfIdx topWall = 0;
    AkSurfIdx leftWall = 0;
    AkSurfIdx floor = 0;
    AkSurfIdx ceiling = 0;
    AkTriangle triangles[] = {
    {0, 1, 2, bottomWall},
    {1, 2, 3, bottomWall},
    {2, 3, 4, rightWall},
    {3, 4, 5, rightWall},
    {4, 5, 6, topWall},
    {5, 6, 7, topWall},
    {6, 7, 0, leftWall},
    {7, 0, 1, leftWall},
    {0, 2, 4, floor},
    {0, 4, 6, floor},
    {1, 3, 5, ceiling},
    {1, 5, 7, ceiling}
    };
    // Only a single surface is required
    surface.transmissionLoss = 0.f;
    surface.surface = "Transparent"
    geometryParams.NumVertices = 8;
    geometryParams.Vertices = vertices;
    geometryParams.NumTriangles = 12;
    geometryParams.Triangles = triangles;
    geometryParams.NumSurfaces = 1;
    geometryParams.Surfaces = &surface;
    AK::SpatialAudio::SetGeometry(BOX_GEOMETRY_ID, geometryParams);
    // Create an instance of the geometry that defines the Reverb Zone
    //
    AkGeometryInstanceParams instanceParams;
    instanceParams.GeometrySetID = BOX_GEOMETRY_ID;
    // Customize the scale and position of the forest.
    AkVector scale = {WIDTH, HEIGHT, DEPTH};
    instanceParams.Scale = scale;
    position.SetOrientation(0.f, 0.f, 1.f, 0.f, 1.f, 0.f);
    position.SetPosition(X, Y, Z);
    instanceParams.PositionAndOrientation = position;
    // This geometry instance is only used to define the Reverb Zone
    instanceParams.UseForReflectionAndDiffraction = false;
    AK::SpatialAudio::SetGeometryInstance(FOREST_GEOMETRY_INSTANCE, instanceParams);
  3. Create a Room for the forest. Call set AK::SpatialAudio::SetReverbZone to assign the Outdoors Room as a parent Room, and set the transition region width.
    paramsRoom.TransmissionLoss = 0.f; // Ensure that sound travels from one room to another unoccluded.
    paramsRoom.ReverbAuxBus = AK::SoundEngine::GetIDFromString("Forest_Reverb"); // The ID of the auxiliary bus, defined in Wwise Authoring.
    AK::SpatialAudio::SetRoom(FOREST_ROOM_ID, paramsRoom, "Forest");
    const AkReal32 kTransitionRegionWidth = 10.f; // customize as desired.
    AK::SpatialAudio::SetReverbZone(FOREST_ROOM_ID, AK::SpatialAudio::kOutdoorRoomID, kTransitionRegionWidth)

Reverb Zones and Attenuation

Reverb Zones inherit the behaviors and properties of Rooms when it comes to attenuation, with these added considerations:

Transmission Loss

Normally, a diffraction path never carries transmission loss because only a transmission path can pass through a surface. With Reverb Zones, there are exceptions for the wet path and for room tones, if a diffraction path passes through the transition region of a Reverb Zone with AkRoomParams::TransmissionLoss higher than 0. When this happens, it's possible for different paths from the same room to have different amounts of transmission loss. This can be seen in the Voice Inspector:

In this example of a room tone, there is a transmission path directly from the room to the listener. There is also a path diffracting through a portal. Each path carries a different amount of transmission loss.

Transmission on the direct transmission path is calculated as described in Emitter-Listener (Direct) Connection, as the max of the listener's room and the emitter's room transmission loss. When those rooms are part of different Reverb Zone hierarchies, then transmission loss will be the max of both room and their parents.

On a diffraction path, whenever a path crosses a transition region, the transmission loss of the child room applies (as specified by AkRoomParams::TransmissionLoss), with the final transmission loss being the max of the values found along the path.

Distance

Care needs to be taken to choose which surfaces of a Reverb Zone are transparent (transmission loss is 0) because of their effect on the calculation of distance between an object in the Reverb Zone and its parent room. Any distance calculation to or from a Reverb Zone is taken based on the nearest opaque triangles.

A common example of this is the floor of a large Reverb Zone. If the floor of a Reverb Zone is transparent (has a surface transmission loss of 0), and a listener is positioned to be far away from any walls, then the nearest distance to the parent room will be through the floor, which is usually undesirable.

Another common example is a surface in a Reverb Zone that has a portal to another room. A surface with a portal connected to it should usually be opaque.

In this example, the three highlighted surfaces of a Reverb Zone have been made opaque. The bottom surface is shared with the floor. The left surface is shared with another room and has a connected portal. The top surface is a creative choice representing something like a covered balcony. All other surfaces are transparent.

Reverb Zone Placement Recommendations

  • The AK::SpatialAudio::SetReverbZone API creates hierarchies of rooms. Parent-child relationships are created directly by AK::SpatialAudio::SetReverbZone, and sibling relationships are created by specifying the same parent room for more than one Reverb Zone.
  • Portals cannot be used to connect rooms that are part of the same hierarchy because the transitions between Reverb Zones and their parent rooms are already defined by their transition regions. Calls to AK::SpatialAudio::SetReverbZone or AK::SpatialAudio::SetPortal with parameters that would cause portals to connect rooms within the same hierarchy will fail.
  • A Reverb Zone transition region always connects, and transitions, directly to the parent room, and cannot be used to connect to an adjacent or sibling room. For this reason, if two Reverb Zones are directly adjacent to each other, sharing a wall, then the shared wall should not be transparent. AkAcousticSurface::transmissionLoss should be above 0 for these shared walls. A Reverb Zone cannot directly transition into another Reverb Zone, therefore Reverb Zones and their transition regions should not overlap.
  • Surfaces that are shared with other rooms (including when a Reverb Zone shares surfaces with its parent room) should generally not be transparent. This includes the floor and ceiling of a Reverb Zone when sounds are not meant to propagate through those surfaces.
  • Similar to Portals, the size of a Reverb Zone's transition region determines area over which the properties of a Reverb Zone take effect. Large transition regions may be desired for smooth transitions into Reverb Zones.
Triangle for a spatial audio mesh.
AkTriIdx NumTriangles
Number of triangles in Triangles.
AkReal32 transmissionLoss
AKSOUNDENGINE_API AKRESULT SetReverbZone(AkRoomID in_ReverbZone, AkRoomID in_ParentRoom, AkReal32 in_transitionRegionWidth)
AkAcousticSurface * Surfaces
void SetPosition(const AkVector64 &in_position)
Set position.
Definition: AkTypes.h:487
AkVertIdx NumVertices
float AkReal32
32-bit floating point
AkUInt16 AkSurfIdx
Position and orientation of game objects in the world (i.e. supports 64-bit-precision position)
Definition: AkTypes.h:422
AKSOUNDENGINE_API AKRESULT SetGeometry(AkGeometrySetID in_GeomSetID, const AkGeometryParams &in_params)
void SetOrientation(const AkVector &in_orientationFront, const AkVector &in_orientationTop)
Set orientation. Orientation front and top should be orthogonal and normalized.
Definition: AkTypes.h:507
AKSOUNDENGINE_API AKRESULT SetGeometryInstance(AkGeometryInstanceID in_GeometryInstanceID, const AkGeometryInstanceParams &in_params)
AkTriangle * Triangles
Vertex for a spatial audio mesh.
Parameters passed to SetGeometryInstance.
constexpr AkRoomID kOutdoorRoomID
The outdoor room ID. This room is created automatically and is typically used for outdoors,...
AkSurfIdx NumSurfaces
Number of of AkTriangleInfo structures in in_pTriangleInfo and number of AkTriIdx's in in_infoMap.
AKSOUNDENGINE_API AkUInt32 GetIDFromString(const char *in_pszString)
AkVertex * Vertices
Number of vertices in Vertices.
3D vector for some operations in 3D space. Typically intended only for localized calculations due to ...
Definition: AkTypes.h:362
AkGeometrySetID GeometrySetID
Parameters passed to SetGeometry.
AkWorldTransform PositionAndOrientation
AKSOUNDENGINE_API AKRESULT SetRoom(AkRoomID in_RoomID, const AkRoomParams &in_Params, const char *in_RoomName=nullptr)

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