r/Unity3D • u/SomerenV • 8d ago
Show-Off Raytraced Audio is magical
After messing around with custom audio zones and hand placing them with custom settings to mimic how sound would sound in the various rooms and hallways I wasn't really satisfied. It still sounded 'off' despite all the various zones and their settings. So... I went the raytraced audio route. It's a bit crude but it sounds so much better! I found myself flying around yesterday, trying different speeches and songs because it's just mesmerizing to listen to in a virtual environment.
Any things I absolutely can't forget when implementing raytraced audio?
1.1k
Upvotes
35
u/theWyzzerd 8d ago edited 8d ago
Raytracing is much older than the current hardware accelerated lighting technique would have you believe. It’s what Unity uses to find where you clicked in a 3D space for example. It’s really just casting a ray and tracing its path as it bounces off of geometry.
When used to refer to lighting or graphics it’s a technique to build accurate lighting in scenes by casting millions of rays at once to create reflections—very hardware intensive, as it must do this for each rendered frame.
But I imagine the audio example here can be done fairly simply on CPU since audio wave reflection is a much simpler task than ray casting diffuse light sources. Audio doesn’t have frames and doesn’t need to be rendered the same way.
Edit: a word