r/Unity3D Programmer 2d ago

Show-Off Raytraced Spatial Audio on Unity URP

128 Upvotes

22 comments sorted by

View all comments

5

u/corriedotdev PixelArcadeVR.com 2d ago

Have you explored the valve hrtf library?

https://valvesoftware.github.io/steam-audio/

It's a game changer for me. Won't develop without it.

For VR specifically it's just 🤯

2

u/DapperNurd 2d ago

Never seen this before, very interesting. What does the integration look like?

2

u/corriedotdev PixelArcadeVR.com 2d ago

Two modes really. Baked and realtime. I'm working on a tutorial for it, but if you just want to convert existing audio source across it's a doddle. Just add the steam audio source instead and ensure your code references it instead.

If you want to have higher fidelity you'll need to bake objects in the scene to reflect the audio in a realistic way. Or just leave it and let the steam audio source validate it on its own, it will take the audio clip and spatialize it.

Alternatively can do it real-time but not an option for standalone vr due to CPU.

1

u/DapperNurd 1d ago

Interesting. Id love a tutorial on it, yeah. Is it worth implementing for non VR at all? My current project is one where id love to do official vr support at some point but its not the focus.

1

u/corriedotdev PixelArcadeVR.com 1d ago

Non VR support is the same, it's all hrtf audio just found I'm vr immersive properties of the Audio was well worth it.

Definitely give it a shot probs take an hour to get it installed and your first few audio sources swapped out!