Table of Contents

Surface Reflectors Tutorial

In the following steps, this tutorial will show you how to use the new Reflect plug-in with Spatial Audio. You will need a Reflect plug-in license to make the project work.

Note.gif
Note: This tutorial presumes that you have completed the Preparation for the Spatial Audio Tutorials. However, it does not consider if the Rooms and Portals Tutorial was done; both tutorials are independent.

A. Wwise Project

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

  1. Add an Auxiliary Bus under the Master Audio Bus. In the Auxiliary Bus Property Editor,
    1. Under the General Settings tab, change the Channel Configuration to mono. Making the bus mono will not affect Reflect's output. You will be able to configure the output in the Reflect Effect Editor.
      AuxBusPropertyEditorGeneralSettingsThirdPerson.png

      Auxiliary Bus Property Editor General Settings tab for Reflect

    2. Under the Effects tab, add the Wwise Reflect Effect.
      AuxBusPropertyEditorEffectsThirdPerson.png

      Auxiliary Bus Property Editor Effects tab for Reflect

    3. Under the Positioning tab, enable Listener Relative Routing and select None for the 3D Spatialization. Do not add an attenuation, you will be able to customize attenuation in the Reflect Effect Editor.
      AuxBusPropertyEditorPositioningThirdPerson.png

      Auxiliary Bus Property Editor Positioning tab for Reflect

  2. Import Reflect Acoustic Textures from: Project > Import Factory Assets...
    1. They will be added to the Virtual Acoustics folder in the ShareSets tab of the Project Explorer view.
      ProjectExplorerShareSets.png

      Factory Reflect Acoustic Textures in the Project Explorer ShareSets tab

    2. (Optional) You can add custom Acoustic Textures in the Virtual Acoustics folder under Default Work Unit.
  3. Save your project.

B. Spatial Audio Emitter

We need to modify the spatial audio emitter to use our newly created reflect aux bus.

  1. Refresh your Wwise project in the Wwise Picker: Windows > Wwise Picker
    1. Generate SoundBanks
      WwisePicker.png

      Wwise Picker

  2. Modify the AkSpatialAudioEmitter component of each button.
    1. Pick the Reflect Auxiliary Bus for Reflect Aux Bus.
    2. Choose 100000 for the Reflection Max Path Length.
    3. Choose 1 for the Reflections Aux Bus Gain.
    4. Choose 2 for the Reflections Order.
    5. Check the Draw First Order Reflections and Draw Second Order Reflections under Debug Draw.
      AkSpatialAudioEmitterReflect.png

      AkSpatialAudioEmitter for Surface Reflector

C. Surface Reflector Component

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 want to create a new GameObject to act as a surface reflector. 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. Here's our steps:

  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. In the Acoustic Texture parameter, choose an acoustic texture or leave it at None to have an unfiltered reflection.
        AkSurfaceReflector.png

        AkSurfaceReflector component

D. Verify your Set Up

  1. Start the game and play one of the emitters.
    1. Since we have enabled the drawing of reflections under Debug Draw in section , you should see rays going from the emitter to the listener in the Scene window. The yellow rays are first order reflections, i.e. they reflect from one surface before reaching the listener, and the orange rays are second order reflections. The name of the GameObject is displayed at the reflection point. You can see the rays in the Game window by enabling Gizmos.
      DebugDraw2ndOrderTop.png

      Top view of early reflection drawings for existing mesh surface reflectors

    2. Connect the game in Wwise and go to the Profiler Layout. You should see a similar graph:
      VoiceGraphReflect.png

      Voice Graph with Reflect Effect

    3. 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.
        ReflectEffectEditor.png

        Reflect Effect Editor View

    4. 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.
        GameObject3DViewerSettingsReflectionPaths.png

        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. In the following image, you can see the surface reflectors in a solid teal color (the color of their Acoustic Texture). For reflection paths and image sources, yellow represents first order reflections and orange second order reflections. In the image, only the reflection paths and image sources of Button Outside are displayed because it's the source that is playing at the moment.
        GameObject3DViewerReflect.png

        Game Object 3D Viewer

        Note.gif
        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.
Generated on Sat Aug 17 14:24:59 2019 for Wwise Unity Integration by  doxygen 1.6.3