Simulating Sound Occlusion and Propagation in Games
Creating immersive audio in video games requires simulating how sound waves travel through and interact with physical environments. This article explores the key techniques and technologies game audio designers use to model realistic sound occlusion and propagation—such as raycasting, acoustic portals, and real-time digital signal processing (DSP) filters—to make virtual worlds sound authentic.
Understanding Occlusion, Obstruction, and Propagation
To simulate realistic sound, audio engines must differentiate between how various physical barriers affect audio:
- Occlusion: Occurs when both the direct sound path and its reflections are blocked by a solid barrier (such as a thick concrete wall). The sound becomes significantly quieter and muffled.
- Obstruction: Occurs when the direct path of the sound is blocked, but the reflected sound (reverb) can still bounce around the obstacle to reach the listener (such as a pillar in a large room).
- Propagation: The physical travel of sound waves through space, bending around corners (diffraction) and passing through openings like open doors or windows (transmission).
Raycasting and Geometry Analysis
To determine if a wall or object is blocking a sound, audio engines utilize raycasting. The engine casts invisible lines (rays) from the sound source to the player’s character (listener).
If a ray intersects with a piece of game physics geometry, the engine calculates the material properties of that geometry. For example, a drywall partition will allow more high-frequency sound to pass through than a thick steel door. The engine then applies specific attenuation (volume loss) and filtering based on these material tags.
Acoustic Portals and Spatial Audio
For complex indoor environments, relying solely on raycasting is computationally expensive and can result in unnatural sound transitions. Designers use Acoustic Portals to solve this.
Portals are invisible 3D volumes placed at transitions between rooms, such as doorways, windows, and ventilation shafts. * Pathfinding: When a sound plays in an adjacent room, the audio engine treats the portal as the temporary source of the sound. * Diffraction: As the player moves away from the doorway, the sound realistically bends around the frame, shifting in directionality and volume to match the player’s perspective.
Digital Signal Processing (DSP) Filters
Once the engine determines how much a sound is blocked, it uses DSP filters in real-time to alter the audio signal:
- Low-Pass Filters (LPF): Solid objects naturally absorb high-frequency sounds while allowing low-frequency sounds to pass through. Applying a low-pass filter removes the treble, creating a muffled, “behind-the-wall” effect.
- Reverb Send Adjustment: When a sound is occluded, the direct dry sound is heavily filtered, while the wet reverb of the room the sound is originating from is dynamically mixed to simulate environmental space.
Modern Spatial Audio Engines
Modern game development relies on middleware like Audiokinetic Wwise and FMOD, alongside game engine tools like Unreal Engine’s Audio Engine and Unity’s spatializer plugins. These tools feature automated propagation systems:
- Dynamic Geometry Mapping: Audio engines can automatically build an acoustic map of the 3D environment, eliminating the need to place portals manually.
- Audio Ray Tracing (Path Tracing): Utilizing GPU acceleration, modern systems can trace hundreds of sound paths in real-time, calculating exact reflections, delays, and absorption rates based on the actual materials of the virtual room.