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 Unity Integration Documentation
Surface Reflectors Tutorial

In the following steps, this tutorial will show you how to use the Reflect plug-in with Spatial Audio in Unity. You will need a Reflect plug-in license to generate SoundBanks, but you can still try it out when connected to Wwise Authoring.

Note:This tutorial presumes that you have completed the Preparation for the Spatial Audio Tutorials.

A. Wwise Project

We need to update our Wwise project with an Auxiliary Bus with the Reflect plug-in and Acoustic Textures.

  1. Import the factory assets to get access to an Auxiliary Bus preset and factory Acoustic Textures.
    1. Navigate to Project > Import Factory Assets...
    2. Choose Reflect and Acoustic Textures and press OK.
  2. Acoustic Textures are located in the Virtual Acoustics folder in the ShareSets tab of the Project Explorer view.
    Factory Reflect Acoustic Textures in the Project Explorer ShareSets tab
    1. (Optional) You can add custom Acoustic Textures in the Virtual Acoustics folder under Default Work Unit.
  3. Add an Auxiliary Bus for early reflections.
    1. Right-click on the Master Audio Bus, navigate to New Child > Presets and select Early Reflection Auxiliary Bus.
  4. Modify the Sound added in Preparation for the Spatial Audio Tutorials
    1. In the General Settings tab, add the newly created Auxiliary Bus with Reflect in the Early Reflections box.
      Specify the Reflect Auxiliary Bus in the General Settings tab of the Sound Property Editor
  5. Save your project.

B. Unity Project

You can simulate early reflections on surfaces with the AkSurfaceReflector component. One way is to add the surface reflector component to an existing mesh of the game. If the shape is too complex, too many triangles will be sent to the Spatial Audio API and this could slow down your game. In this case, you may add a different mesh in the AkSurfaceReflector component itself; a collision mesh, for example. Another way to add reflective surfaces is to create a new GameObject. In the scene provided by the Wwise Unity Demo Scene, new objects were used for surface reflectors. Since the rooms are cube shaped, we used cubes with no mesh renderer.

  1. Create a cube: GameObject > 3D Object > Cube
    1. Remove the Mesh Renderer component
    2. Check the Is Trigger in the Box Collider component
    3. add an AkSurfaceReflector component.
      1. The mesh parameter can be left to None if the mesh from a MeshFilter component is to be used. If not, the wanted mesh can be added here.
      2. In the Acoustic Textures array, choose an acoustic texture for each submesh (there is only one submesh for the cube) or leave it at None to have an unfiltered reflection.
      3. In the Transmission Loss Values array, you can set the transmission loss value of the surfaces of each submesh. These will be used to filter the sound going through the mesh. Refer to the D. Transmission section for further details.
      4. You can enable diffraction with the Enable Diffraction checkbox. Refer to E. Associate rooms to Surface Reflectors (Deprecated) for details.
      5. Lastly, leave Associated Room set to None. More details in the E. Associate rooms to Surface Reflectors (Deprecated) section.
        AkSurfaceReflector component
  2. The order of reflection is set in the AkWwiseInitializationSettings, under Spatial Audio Settings
    1. By default, the reflection Order is set to 1. You can set it up to 4.
      Spatial Audio Init Settings
  3. If you want to see reflections paths drawn into the scene, you can add the AkSpatialAudioDebugDraw component to an emitter.
    1. Tick the reflections orders you want to be drawn.
      AkSpatialAudioDebugDraw component

C. Verify your Setup

  1. In the Wwise Picker: Windows > Wwise Picker
    1. Generate SoundBanks
      Wwise Picker
  2. Start the game and play one of the emitters.
    1. Connect the game in Wwise and go to the Profiler Layout. You should see a similar graph:
      Voice Graph with Reflect Effect
    2. Double click on the highlighted Wwise Reflect under the Auxiliary Bus node in the graph to open the Reflect Effect Editor. When playing the sound, you should see the current reflections in the graph and the list. When there are two textures under the Texture(s) column, the reflection is a second order one.
      1. Here you can modify the attenuation curves of the reflections.
      2. If you don't see any reflections, make sure Max Distance is high enough compared to the reflection distance between the emitter and the listener.
        Reflect Effect Editor View
    3. Navigate to the Game Object Profiler Layout (shortcut F12)
      1. If not done already, make sure you enable Reflection Paths and Reflection Image Sources in the Game Object 3D Viewer Settings.
        Game Object 3D Viewer Settings for Reflect
      2. In the Game Object 3D Viewer, you should see surface reflectors and reflection paths between playing emitters and the spatial audio listener.
        Game Object 3D Viewer
Note:If you can't see any geometry in the Game Object 3D viewer, you may need to increase the Monitor Queue Pool Size in the Initialization Settings. Refer to the following page Adjusting Wwise Initialization Settings.
Note:Note that with a cube shaped surface reflector around the building, it is not possible to get any reflection paths from the emitters inside the building when the listener is outside, or vice versa, even if the emitters are playing. This is because the opening of the building is part of the reflective surface. This can be fixed by either only using the building's mesh as a surface reflector or by placing a portal around the opening. More on portals in the Rooms and Portals Tutorial.
See also

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