A First Look At Raytraced Audio — Transcript
Full transcript
- 0:00Have you ever been confused by audio in
- 0:02games where you couldn't tell which
- 0:03direction a sound came
- 0:07from? I've spent seven years creating a
- 0:09game engine and I figured out a way to
- 0:11use ray tracing to get realistic 3D
- 0:13audio. And it can also be used to
- 0:16visualize sound for deaf people. This
- 0:18process has three steps and the first is
- 0:21about tricking your brain. Your brain
- 0:23relies on many factors like the shape of
- 0:25your ears to work out which direction a
- 0:27sound came from. But in games, you can
- 0:29only hear sound from your left and right
- 0:31headphones. To solve this, games use
- 0:34binaural audio, which simulates how
- 0:36sound waves interact with your head and
- 0:38ears. This tricks your brain into
- 0:40thinking a sound came from a specific
- 0:42direction. Most games use this already,
- 0:44but they still have issues with their
- 0:46audio. We can solve these problems using
- 0:48ray tracing. Let's say you're working in
- 0:51an office and someone's talking in the
- 0:53room next to you. When you hear them
- 0:55talk, their voice will be deeper than
- 0:56usual. But you don't think, "That's
- 0:58strange. Jaime's voice sounds really
- 1:00deep today." Your brain subconsciously
- 1:02understands that there's something
- 1:04between you and them, and that their
- 1:05voice will sound a bit deeper than
- 1:07usual. Then, if their voice sounds
- 1:09normal, you'll know that they've opened
- 1:10the door. Just by listening, you've
- 1:13noticed things about the environment
- 1:14around you, and this is crucial for 3D
- 1:16games. To muffle sounds, most games use
- 1:19a room-based audio system. So, if you're
- 1:22standing in this room, sounds in the
- 1:24other rooms will be muffled. But it gets
- 1:26complicated when rooms have strange
- 1:28shapes. If you're standing here, how
- 1:30muffled should a sound over here be? And
- 1:33it gets more complicated because some
- 1:34rooms might have thicker walls, doors
- 1:36that open and close, or they might even
- 1:38be destructible. This is where ray
- 1:41tracing comes in. Instead of setting up
- 1:43rooms for our level, we'll fire rays
- 1:45outwards from your player. These rays
- 1:48travel faster than your eyes can see, so
- 1:50I've slowed them down for this
- 1:51demonstration. They also move in three
- 1:53dimensions, but these animations use
- 1:55two, so they're easier to look at. Also,
- 1:58in real life, sound travels towards your
- 2:00ears, but these rays are doing the
- 2:02opposite. This isn't a perfect
- 2:04simulation of real life. These rays are
- 2:06trying to discover sounds and learn
- 2:08about the environment around you. We
- 2:10don't have any sounds right now, so I'll
- 2:12play some music in this room. Now we can
- 2:14see a new kind of ray that travels
- 2:16directly towards the music. The more
- 2:18green rays there are, the clearer the
- 2:20sound. Listen to how the music changes
- 2:23when the room closes
- 2:25[Music]
- 2:30up. We can change the entire shape of
- 2:33this building and the rays will
- 2:34automatically figure out how muffled the
- 2:36music should be. But ray tracing can do
- 2:38so much more than this. Here we're
- 2:40inside a large room and will fire rays
- 2:42outwards like before. Each time the rays
- 2:45bounce, they'll check for line of sight
- 2:46back to your player. These blue rays
- 2:49represent echo in real life. I used to
- 2:51think echo was just based on the size of
- 2:53the room. But one day, I helped my
- 2:55parents empty out their garage. As we
- 2:57cleared out more stuff, the echo got
- 2:59stronger. That's because there were no
- 3:01more cars and other stuff lying around
- 3:03the garage that sound could get lost
- 3:05behind. Now that it's empty, nearly all
- 3:07the sound is reflecting off the walls
- 3:09and back to my ears. The room is the
- 3:12same size as before, but the echo is
- 3:14much stronger. To have accurate echo in
- 3:16every scenario, we need to blend between
- 3:18a few states. The first state is a small
- 3:21room where you hear the echo instantly.
- 3:24This could be a bathroom where the walls
- 3:25are very close to you. The second state
- 3:28is a large room where the walls are far
- 3:30away. It takes a while for these blue
- 3:32echo rays to return to you, so the echo
- 3:34sounds delayed. We'll blend between
- 3:36these two states based on the length of
- 3:38the
- 3:39Blu-rays. The next step is related to
- 3:41the garage from before. If all of the
- 3:43Blu-rays return to you, then the echo
- 3:45should be loud. But as less blue rays
- 3:48return to you, the echo should be
- 3:50quieter. This works great, but it only
- 3:52applies to indoor sounds. We need to
- 3:54support outdoor environments as well. If
- 3:57our building has some broken walls, some
- 3:59of the rays will leave the building. If
- 4:01they reach the edge of the level, we'll
- 4:03say that they escaped outdoors.
- 4:05As an optimization, these rays will keep
- 4:07bouncing around so they can gather more
- 4:09data. Now we can blend between an indoor
- 4:11and an outdoor state based on how many
- 4:13rays escape. Now that we can tell if a
- 4:16player is inside or outside, we can add
- 4:18another cool feature. When you're at
- 4:20home in a thunderstorm, you'll hear
- 4:21muffled rain all around you. But if you
- 4:24open a window, it will sound like the
- 4:25rain is coming from that window
- 4:27specifically. We can simulate this using
- 4:30the escaping rays. The average direction
- 4:33of all escaping rays is the direction we
- 4:35should hear the rain from. But what if
- 4:37we're in another room and we don't have
- 4:39clear line of sight with the window.
- 4:41Let's follow the path of one ray. Since
- 4:43it eventually escapes out the window, we
- 4:45can use it to figure out the direction
- 4:47of the rain. We can do this using the
- 4:49blue echo rays. The last blue ray is the
- 4:52direction that we should hear the rain
- 4:54from. I'll color this ray yellow and
- 4:56repeat the process with every ray. The
- 4:59average of all these rays is the
- 5:00direction we should hear the rain from.
- 5:03As your player moves around, you can see
- 5:04the rays point towards the
- 5:06window. The final feature is related to
- 5:09wall thickness. Here we have two rooms,
- 5:12and the one on the left has thicker
- 5:13walls than the right. Sounds in the thin
- 5:15room should be less muffled than the
- 5:17thick one, but currently our rays stop
- 5:19when they hit a wall. So, let's use a
- 5:21new kind of ray that travels all the way
- 5:23to the sound. The longer these rays
- 5:25spend inside a wall, the more energy
- 5:27they'll lose. Let's graph this energy on
- 5:29the right. Each column represents one
- 5:32ray, and its height is how much energy
- 5:34it has. When the speaker moves inside
- 5:36the thicker room, we can see the energy
- 5:38drop. To work out how muffled a sound
- 5:41should be, we use the green rays from
- 5:42before, as well as the energy left in
- 5:44these orange rays. When used together,
- 5:47these four ray tracing features produce
- 5:49realistic audio in complex environments.
- 5:52But we can also use ray tracing to
- 5:54visualize sound for deaf people.
- 5:56Somewhere here there's an enemy firing
- 5:58their gun. Since deaf players can't hear
- 6:00them, we need another way to locate
- 6:02them. Before we were casting rays
- 6:04outwards from your player, but instead
- 6:07we'll cast rays outwards from the enemy.
- 6:09When these rays hit a surface, a small
- 6:11dot will appear there. As the enemy
- 6:13moves around, the dots will update in
- 6:15real time. If the enemy stops making
- 6:18noise, the dots will disappear. Some
- 6:20sounds like explosions can be heard from
- 6:22far away, so the dots should be larger.
- 6:25But when an enemy is sneaking around,
- 6:27the dots should be smaller. The color of
- 6:29the dots can also convey the type of
- 6:31sound. Gunfire could have red dots and
- 6:34footsteps might have green dots. If a
- 6:37player is color blind, we can also
- 6:39change the shape of the dots. Deaf
- 6:41players can now see 3D sound visualized
- 6:44around them. I'm still working on this
- 6:46feature, and I'd love to hear your
- 6:47feedback. So, do you need an expensive
- 6:50graphics card to run this? The answer is
- 6:52no. This system works on everything from
- 6:55old laptops to the latest spaceships.
- 6:57That's because when you play a game,
- 6:59your input is handled by your CPU, which
- 7:01tells your graphics card what to render,
- 7:03and then your monitor displays it.
- 7:05Whereas, ray traced audio runs on
- 7:07background threads on your CPU and then
- 7:09sends the output to your headphones.
- 7:11This separation allows your game to
- 7:13continue to run smoothly. The ray
- 7:15tracing is also performed against a
- 7:17voxal grid which is much faster to ray
- 7:19trace against than triangulated models.
- 7:22The size of the voxels can also be
- 7:24increased to make it run even faster.
- 7:26This ray traced audio system will be
- 7:28available as a paid plugin for major
- 7:30game engines soon, but I need your help
- 7:32testing it. If you're a game developer,
- 7:35let me know if you'd like to help out.
- 7:37The code for the rest of my engine and
- 7:38the animations in this video can be
- 7:40accessed in the video description. I
- 7:43also optimized another kind of rate
- 7:44tracing up to 11,000 frames per second
- 7:47which you can watch in this video on
- 7:48screen.
About this transcript
This page contains the full transcript of A First Look At Raytraced Audio by Vercidium, generated from the public captions YouTube serves with the video. The transcript has 1,529 words across 220 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.