Raytracing Audio For Games

If you’ve ever been playing a game and suddenly thought, “Wait, where did that sound come from?” then you’re not alone. It’s surprisingly easy to get lost when audio isn’t doing its job properly. In the real world, your brain does a marvellous job of figuring out the direction, distance and even texture of sound using all sorts of clever tricks. It uses things like the shape of your ears, how the sound bounces around the room, and whether it reaches one ear just a fraction of a second before the other. But in most games, sound just goes left or right. Which is why, when a game gets it wrong, it feels jarring.

Enter ray tracing. Not the shiny graphics one, but its lesser-known (and much more useful) cousin: raytraced audio. I recently came across a brilliant developer on YouTube called Vercidium (his YouTube Channel is here) who’s spent seven years building a game engine from scratch, and they’ve come up with a way to use ray tracing to simulate truly realistic 3D audio. And yes, that also includes a way to make sound visible for deaf players.

Now before we get too deep, let’s quickly talk about ray tracing in general. In graphics, ray tracing simulates the path of light as it bounces around a scene, calculating how it reflects, refracts and diffuses off surfaces. It’s how you get realistic shadows, reflections and lighting. It’s computationally heavy, but beautiful. Raytraced audio works in a similar way, but instead of light rays bouncing around, you’re tracing how sound waves might move through a virtual space.

And this is where it gets clever. Because real sound doesn’t just go from a speaker to your ear. It interacts with the environment. It bounces, it gets absorbed, it gets muffled or amplified. And your brain does a remarkable job of understanding all this without you even noticing. For example, if someone talks to you through a wall, their voice will sound slightly deeper and less clear. Your brain doesn’t go, “That’s weird,” it just goes, “There’s a wall in the way.”

Most games simulate this sort of thing using a room-based audio system, where sounds in other rooms are muffled by default. But as soon as rooms get oddly shaped or destructible or involve doors that open and close, it becomes a nightmare to manage. Raytraced audio avoids all of that by skipping the manual setup and letting rays figure it out. Instead of setting up walls and triggers and zones, it simply fires out rays from the player’s position to see what’s going on around them.

Audio rays being traced between rooms

Those rays don’t behave exactly like real sound waves. They actually run backwards. Instead of sound coming to you, they go out from you, searching for sound sources and learning about the space. It’s not a perfect recreation of physics, but it turns out your brain doesn’t need perfect. It just needs believable.

You can watch this in action in the video as green rays shoot from the player and find the shortest path to a sound source. The more green rays that make it, the clearer the sound. Close the room off and the sound gets muffled. Open a door, and it comes back. The beauty of this approach is that the whole shape of the space can change and the system still works.

It doesn’t stop there. The system creates a more nuanced reverb that changes depending on the size of the room and how much stuff is in it. The developer discovered this after clearing out their parents’ garage and suddenly noticing a stronger echo. Same space, fewer obstacles. The echo was louder because the sound had fewer things to get lost behind.

To simulate this effect properly, the system blends between a small room (where echoes hit you fast and sound loud) and a large room (where they come back slowly and softly). If all the rays make it back, the echo is strong. If most of them get absorbed or lost, it’s quiet. Simple idea, brilliant execution.

The system also works for outdoor spaces. If some of the rays escape the building entirely, it knows you’re near an opening. Even better, it can tell where the opening is. Like when you’re indoors during a thunderstorm and you hear the rain mostly through the window. It traces which rays escape and where, then uses that to position the sound.

It gets even more clever. By following rays that bounce around and eventually escape, it figures out not just that you’re near a window, but which direction you should hear the rain from. So if you’re in another room, facing the wrong way, it still feels like the rain is coming from the window. It even updates in real time as you move.

Then there’s wall thickness. Not all walls are created equal. Some are paper-thin, others are solid concrete. In a game, that difference should matter. So the system uses new rays – orange ones – to measure how much energy a sound loses while travelling through a wall. The longer a ray spends inside a wall, the more energy it loses. You can see the energy drop visualised as a little graph, and when it drops below a certain level, the sound gets muffled accordingly.

The effect walls have in a space and the way the rays trace.

And then there’s the bit that really got me. Raytraced audio for deaf players. Instead of casting rays from the player, it casts them from the enemy. When those rays hit a surface, they leave behind little dots. Gunshots? Red dots. Footsteps? Green ones. Explosions? Big orange blobs. If the player is colourblind, the shapes change too. The player can now seesound. Not in some vague HUD icon kind of way, but actually visualised in the 3D world, updating in real time, and fading out as the sound dies away. It’s proper accessibility. Done right.

Raytraced audio helps assist deaf and colour blind players

And the best part? It doesn’t require some fancy graphics card. It all runs on the CPU, and on background threads, no less. The graphics card keeps doing its thing, and the raytraced audio happens separately. It uses voxels too, which are way faster to trace than traditional polygon models. And if you need it to run even faster, just use bigger voxels.

It’s going to be released as a plugin for major game engines soon, and the developer is looking for testers. So if you’re building a game, maybe give it a whirl. It’s rare that you see something this thoughtful and functional that works on everything from an old laptop to a spaceship.

In a world of flashy graphics, it’s lovely to be reminded that sound matters too. It might not always be visible, but with the right tools, it can be felt. Or even seen.