
We have just released Steam® Audio 2.0 beta 14, which brings support for Intel® Embree technology. Embree is a high-performance software library for ray tracing. Steam® Audio uses ray tracing to simulate sound propagation, occlusion, transmission, and reverberation; using Embree lets Steam® Audio achieve performance gains of 4-6x during real-time simulation and baking. For example, reverb bakes that required half an hour using the built-in ray tracer should now take just about 5 minutes with Embree. Real-time simulation that updated 2 times per second with the built-in ray tracer should now update about 8-10 times per second with Embree.
Click here to download the latest version of Steam® Audio, or click here to grab the source code for the plugins.
Embree support is optional in Steam® Audio; Steam® Audio continues to work on any PC with any CPU (with or without Embree), as well as on ARM-based Android devices (without Embree).
How is Embree useful to Steam® Audio?
Steam® Audio uses ray tracing for simulating occlusion, transmission, and reflection of sound. Rays are traced from the listener (typically the player) to a sound source to find out if it is occluded by a solid object. The material properties of these occluding surfaces are also used to figure out how much sound, if any, is transmitted through the surfaces.
To simulate reflections, rays are traced from the listener and bounced around the scene until they hit one or more sources. The surfaces hit by the rays determine how much energy is absorbed, and how much reaches the listener from the source. These energies, along with the arrival times of each ray, are used to construct the impulse response from the source to the listener. An impulse response (IR) is an audio filter that represents the acoustics of the scene; rendering a sound with the IR creates the impression that the sound was emitted from within the scene.
The above approach is also used when simulating reverb from the player's position. Baking indirect sound or reverb involves calculating IRs for many positions when designing the scene rather than when playing the game.
The performance impact of ray tracing is felt as latency in Steam® Audio. If ray tracing takes too long, then there may be an observable delay between something changing on-screen, and the corresponding IR updating. For example, if a source moves from a small room to a large room, and ray tracing takes too long, the audio may not update to sound like it's coming from a large room until a few frames after the source enters the large room. The high performance ray tracing enabled by Embree allows Steam® Audio to simulate more sources in greater detail without introducing noticeable latency in IR updates.
What is Embree?
Embree contains efficient data structures and algorithms for tracing coherent rays (direct light) and incoherent rays (global illumination, sound propagation). Embree is highly optimized for SIMD (Single Instruction Multiple Data) instructions present in modern CPUs based on the x86 (32-bit) and x86_64 (64-bit) architectures. In particular, Embree can use SSE2, SSE4, AVX, or AVX2 instructions, depending on the capabilities of the user's CPU. Embree delivers a greater performance boost on AVX- and AVX2-capable CPUs, as compared to SSE2- or SSE4-capable CPUs.
For additional performance gains, we also rewrote portions of our reflection simulation algorithm using the Intel® SPMD Program Compiler (ISPC). SPMD here refers to Single Program, Multiple Data, i.e., an abstraction where code is written as if it were designed for serial, non-SIMD execution, but the compiler transforms the code to use SIMD instructions automatically. ISPC is built as a set of extensions to C, and it was relatively straightforward to convert selected portions of Steam® Audio code to ISPC. For maximum compatibility, our ISPC code is designed to run on CPUs supporting SSE2, SSE4, AVX, or AVX2 instructions.
What are the benefits of Embree?
When using Steam® Audio for real-time simulation of reverb or sound propagation, Embree results in significant speedups over Steam® Audio's built-in ray tracer. This lets games simulate sound propagation for more sources, in greater detail, and with lower latency, resulting in increased immersion.

Figure: Performance of real-time indirect sound simulation when using Embree vs. when using Steam® Audio's built-in ray tracer (Phonon), in the Sibenik cathedral scene. Simulation settings, i.e., number of rays, number of bounces, and number of sources, are varied; IR duration and Ambisonics order are kept constant at 2 seconds and 1st order, respectively. Numbers above the bars indicate speedup of Embree over Phonon.
Similarly, when using Steam® Audio for baking reverb or sound propagation, Embree results in a significant time savings for designers.

Figure: Time taken for baking reverb when using Embree vs. when using Steam® Audio's built-in ray tracer (Phonon), for different scenes: a simple Box, the Sibenik cathedral (80k triangles), and a Hangar scene from the Unity Asset Store (140k triangles). Simulation settings are 32768 rays, 64 bounces, 2 second IR duration, 1st order Ambisonics, and a grid spacing of about 3.7 meters. Numbers inside the orange bars indicate speedup of Embree over Phonon.
All of the above performance numbers were obtained on an Intel Core i7 5930K (Haswell E) CPU, using a single thread, running Windows 10 64-bit.
How do I enable Embree in Steam® Audio?
System Requirements
Embree support in Steam Audio® is available on Windows (64-bit), Linux (64-bit), and macOS (64-bit). Embree support on macOS is available only on Macs released in 2011 or later. Note that even though the Steam® Audio binaries are universal binaries on macOS, Embree support will only work when your application is run in 64-bit mode.
Using the Unity Plugin
To use Embree in a Unity project that uses the Steam® Audio Unity plugin, you must add a Steam® Audio Custom Settings component to the Steam® Audio Manager Settings object in every scene that you wish to use Embree in, and then set Ray Tracer Option to Embree. Refer to the documentation for more details.

Using the FMOD Studio Plugin
Embree support will enabled in the Steam® Audio FMOD Studio plugin in an upcoming release.
Using the Unreal Engine 4 Plugin
Embree support will be enabled in the Steam® Audio Unreal Engine 4 plugin in an upcoming release.
Using the C API
To use Embree in an application that directly uses the Steam® Audio C API, you will need to create a Scene that uses Embree for ray tracing. When calling iplCreateScene or iplLoadFinalizedScene to create a Scene, in the simulationSettings parameter, set sceneType to IPL_SCENETYPE_EMBREE. If the function returns a status code indicating success, then all simulation carried out using the Scene object will use Embree. For more details, refer to the Steam® Audio SDK documentation.
