In June 2018, Valve* announced the release of Steam* Audio 2.0 beta 14, with support for Intel® Embree technology. This software improves performance in sound simulation, offering more immersive experiences for players, and faster bake-times for developers. Intel and Valve collaborated closely to optimize the audio plug-in, and performance measurements show big improvements.
Valve’s newest library release contains two options for audio ray-tracing. One path uses their standard built-in library. The other path uses Intel Embree libraries which incorporate the Intel® SPMD Program Compiler (Intel® SPC), a single program - multiple data program compiler, (commonly referred to as ISPC) for additional performance gains.
Ray-tracing is a rendering technique that generates an image by tracing light paths as pixels in an image plane, then simulates the effects as those paths encounter various objects. The results can be stunning, but the computational requirements are huge, so offline rendering for still images or video effects is the most common usage.
Figure 1. Ray-tracing diagram for rays of light, applicable to point sources for sound (source: Henrik/Wikimedia.org).
People have been talking about ray-tracing coming to video games for a long time. However, the catch has been that ray-tracing requires significant resources. Computationally, the audio requirements are much less expensive than for graphics, so the audio portion is something that can now be done at runtime on the CPU.
The benefits from Intel’s collaboration with Valve are twofold: faster compilations for developers who create the scenarios using Intel’s highly optimized libraries, and more immersive experiences for consumers, as realistic sound effects enhance gameplay. This article looks at both of those advantages in depth, starting with Intel’s technology.
Intel® Embree Libraries Replace Previous Implementation
Created at Intel Labs, and released as an open-source code base, Intel Embree technology is highly optimized for Single Instruction Multiple Data (SIMD) requirements. Intel Embree version 1.1 was first presented at SIGGRAPH in 2012, and is now at version 3.2. Best described as a collection of performance-enhanced ray-tracing kernels, the Intel Embree code base is kept optimized for released Intel® processors, with support for Intel® Streaming SIMD Extensions (Intel® SSE), Intel® Advanced Vector Extensions (Intel® AVX), Intel® AVX2, and Intel® AVX-512 instructions, and works for both light and sound paths. Intel Embree also supports runtime code selection to choose the traversal and build the algorithms that best match the instruction set for a consumer’s CPU.
Valve’s software development team initially collaborated with Intel to add the Intel Embree library as an audio ray-tracing option to their current technology. Adding the second path was straightforward; Valve engineers used a variety of scenes to run reflection simulation algorithms and test the relative performance with and without Intel Embree technology. The resulting performance calculations using the Intel Embree library and Intel SPC represented significant improvement, as seen in Valve*’s announcement.
Intel® SPC Makes Writing Vectorized Code Easier
For additional performance gains, Valve’s engineers also rewrote portions of their reflection simulation algorithm using the Intel SPC, 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. Intel SPC is built as a set of extensions to the C programming language.
Once the Intel Embree library was integrated, the collaboration with Valve continued, exploring whether they might also benefit by looking into adopting Intel SPC to gain additional speedups. Valve engineers again rewrote portions of their reflection simulation algorithm using existing documentation, and got a few pointers from the Intel side. The additional effort to add Intel SPC code was relatively straightforward, and the results were good - replacing some of their code with the Intel SPC code really paid off after a few rounds of fine-tuning. Valve hadn't worked on optimizing this part of the code prior to integrating Intel Embree, because so much time was spent on the ray-tracing code. Once their ray-tracing performance improved dramatically, they found other bottlenecks they hadn’t seen before. Using Intel SPC, they made further improvements.
Increased Immersion for Consumers
When using Steam Audio for real-time simulation of reverb or sound propagation, the new plug-in lets games simulate sound propagation from more sources, in greater detail, and with lower latency, resulting in increased immersion. Whether the audio is coming from footsteps in a hallway, gunfire across the street, or character dialog in the same room, sounds are more realistic. Even surface properties are taken into account, with calculations made for how much sound energy is absorbed, and how much sound should reach the listener. These energies, along with the arrival times of each ray, are used to construct the impulse response (IR), which 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 performance impact of Intel Embree libraries and Intel SPC will be observable by consumers as reduced latency. 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 performance gain allows Steam Audio to simulate more sources in greater detail without introducing noticeable latency in IR updates.
Planning the audio for an environment should be more intuitive using ray-tracing; having a more accurate, more physically-based audio environment will free up some of the time-consuming tweaks that audio designers previously had to devise to create a more realistic audio environment. For consumers, the effects will be subtle, but important. Players moving around in a scene may not be aware at first that the sound source is moving around, too. Allowing developers to quickly update the sound parameters in a scene will provide realistic sound effects, ensuring no breaks in immersion and a better overall experience.
Figure 2. Tactical games place a premium on accurately depicting footsteps, as in this scene from Counter-Strike*: Global Offensive (source: critical-reviews.com).
Ecosystem Benefits from Collaboration
This collaboration with Valve is an example of Intel’s ongoing commitment to the entire gaming ecosystem, as they continue to work closely with other companies to improve development and end-user experiences. Developers gain significant performance increases when baking reverb or sound propagation in a scene using the Intel Embree libraries instead of the built-in ray-tracer in Steam Audio. Consumers benefit from enhanced environments with lush sound propagation from more sources, in greater detail, and with lower latency, that will potentially boost the overall immersive experience.
For game developers looking for the latest audio solutions, it’s well worth taking the time to investigate Steam Audio’s enhanced plug-in, and experience the speedup for yourself. To incorporate ray-tracing for offline work, a free download for Intel Embree libraries can be found in the links below. If looking for an open-source compiler for high-performance SIMD programming on the CPU, check out the documentation for the Intel SPC.