Audio Raycasting Demo
Ойындар
Music To Wear Fingerless Gloves To - by Punch Deck - • Punch Deck - Music To ...
Hey all, it's been about a week since I first shared video of this audio raycasting system. Since then I faced some limitations with OpenAL and had to redo the majority of the system, and I have also optimised the raycasting algorithm, which can now cast 6.4 million rays per second per thread, up from 1.3 million in the first video.
I've also visualised the rays, which helped with debugging and I think it looks cool.
Directional sound calculation and low pass filters have also received an improvement - the low frequencies of a sound will now travel straight to the listener (i.e. the bass can be heard when the sound is enclosed) and the higher frequencies will bounce around in an attempt to reach the listener.
I have also increased how many times each ray bounces. When a sound first plays it casts 484 rays outwards that each bounce up to 8 times, checking for line-of-sight with the listener each time. This process takes ~0.6 milliseconds and happens on another thread, meaning the user will not notice the delay or stutter when multiple new sounds are created at once.
Then - to adapt to changes in the environment and increase ray coverage over time - another thread casts 32 rays out from each actively playing sound, which each bounce up to 32 times. This process takes ~0.15 milliseconds, meaning 16.6 / 0.15 = 110 sounds can be actively playing at once while maintaining 60 FPS on the audio thread.
My next step is to improve outdoor scenarios since the sky is stealing all my rays.
Пікірлер: 57
Verc makes a game, and just casually makes one of the best audio systems I've ever seen. What the hell
@Vercidium
2 жыл бұрын
Haha thank you so much!
imagine if this is a standard for all games. they keep improving the visuals but no one is imrpoving the audio.
Imagine locking up someone and hearing their muffled scream. This better be in GTA 6
When its out were going to be able to make maps so much cooler :D tune in for the opening of the dance floor
@Vercidium
2 жыл бұрын
Can't wait! I'll add sound sources to the map JSON format
Damn this makes me want a Boombox as equipment so I can blast some tunes around the map 😂
@Vercidium
2 жыл бұрын
Haha that would be sick, +2 Loadout Style
@pardontheopinion8679
Жыл бұрын
And 10 months later, this is common in game. =)
Man, you are absolute chad. Can't wait to dabble in this approach myself :D
Sounds neat. It would be inteesting to see absorption rate and reflections added. Example - the difference between a room made of tile, stone, wood, wool, glass, etc, all the same size. Also some diffraction would be appreciated.
This looks insane, phenomenal job.
Amazing! It would be really cool if amplitude affected how far the rays went and also different frequencies represented by rays as different frequences have different wavelengths and thus travel at different speeds and roll off at different distances.
@JJ-fc2ho
2 жыл бұрын
Also this opens up a whole new world for materials. Imagine making sound parameters for materials in blender with nodes.
@Vercidium
2 жыл бұрын
@@JJ-fc2ho thanks! Yeah I agree, I have a lot to learn with how different materials affect different sounds (absorbing some frequencies more than others) but would love to have it implemented. I think the OpenAL 3D audio system manages the roll-off, in one of the recent videos I posted you can hear the thunder when underground but not the rain
Pretty nice. I've noticed you've managed to reduce the jarring transitions between audio levels quite a bit. At around 1:40 there's still a HUGE difference in volume when above the hole or inside, more so than what I deem reasonable. Take a look at it and maybe tone that down a bit, too. Very impressive, keep it up.
Yo dis be insaneeeee 🎉🎉 Keep it up man
@Vercidium
2 жыл бұрын
Thank you!
Nice! I had an idea like this some time ago. I thought it would be good for realistic gun sounds.
thats crazy bro. im a music producer and programmer too (but not this good, just mobile things).. and you could filter the audio a little when its coming from behind. thats how our brain knows its coming from behind, because our ears attenuate the highs and filter it in a special way. i think this is already way too cool, but maybe with a little trick you can make it even more realistic !
@Vercidium
7 ай бұрын
Great point! I've since enabled HRTF and the difference is night and day
Incredible
very inspiring
sick
This is exactly what I was looking
This should be in all FPS game, at least in CS2
My mind is blown
Yes! This is great work! Is the raycasting expensive? There sure are a lot!
Needs some diffraction, so hearing around corners should be slightly louder Regardless, this is an impressive audio system.
@Vercidium
3 ай бұрын
Thank you, great feedback
That’s really cool! Do any sounds penetrate through walls, or would I be totally isolated from outside sounds if I was inside a sealed bunker?
@Vercidium
2 жыл бұрын
Thanks! The audio quality isn’t as great on KZread but the lower frequencies penetrate through when you’re isolated.
Do you limit the speed of the audio rays? Like if there is an explosion that happens kinda far away?
@Vercidium
6 ай бұрын
OpenAL Soft handles that for me, it delays the audio based on the distance between the listener and the sound source. It also simulates redshift for objects moving towards/away from you, it's super cool stuff
really does need to use both ears at all times, seems to use one or the other a bit to much
I'm really fascinated by this. How does it work? are rays being cast from the player to determine distance to the sound? or how big a room is? Or are the rays coming from the sound source itself? I'm not super educated in game development so i'm sorry if i'm way tf off lol.
@Vercidium
6 ай бұрын
1000 rays are cast out from the player in every direction. If a small percentage of rays reach a sound then it will be muffled, and if all rays reach a sound then it will sound clear Reverb is calculated based on how far the rays travel (big vs small room) and how many rays return back to the player (echo)
@starryeyes5860
6 ай бұрын
that is honestly so cool. super easy to understand explanation, thank you for the reply! Such an interesting technology.
How come AAA games aren't doing this? Is it super resource intensive?
@Vercidium
2 жыл бұрын
From what I’ve done so far it’s not that resource intensive. Most AAA games do use these filters and reverb effects, but since they don’t have destructible environments they can specify from the beginning that ‘this part of the map is a small room, this part is outdoors, this sound is in a different room to the player and should have effects X and Y’
@timeSlidrGaming
2 жыл бұрын
@@Vercidium I understand that but I've never heard raycasted audio before and it sounds amazing. It's way different than using zones with reverb effects. I hope this gets into some AAA games. That would be awesome
@silarious9014
2 жыл бұрын
It is more resource intensive for games that aren't voxel, with nearly everything being 90 degree angles and effectively lowest poly count possible raycasting is faster and more simple.
is the sound actually delayed according to the "Path" of the sound? What i'm trying to ask is: Are Echos possible?
@Vercidium
6 ай бұрын
It’s not delayed, OpenAL Soft is used to add reverb effects to sounds
I wonder if my low end pc could run this.
Was this made with unity, godot, unreal or did you make it in something else
@Vercidium
10 ай бұрын
Hey this is a custom engine made with C# and OpenGL
RTX for your ears? Better hide it from Creative lawyers before they steal it for their next overpriced sound card lol For real though, it's looking fantastic! It reminds me of the GSound Demonstration (kzread.info/dash/bejne/lKmJmsmJd5XJeKw.html) which looked really promising, but never really took off AFAIK also, any reason why HRTF was turned off since last video? It really added to the effect
@Vercidium
2 жыл бұрын
HRTF should still be on, let me double check. Good pickup if it's disabled! I looked into GSOUND but couldn't find any technical details about it so decided to start this project :)
@3DJ
2 жыл бұрын
@@Vercidium Someone posted the GSound SDK and source code in the binaural audio server and I just joined yours so if you're interested, you can add me so I can DM you the files 👍
@Vercidium
2 жыл бұрын
@@3DJ sure thing, thank you! Send me a friend request
Зумеры изобрели EAX:
sounds kinda wierd withouth Binaural Audio
@Vercidium
8 ай бұрын
Yeah HRTF wasn’t in use at this point
matrix xd
this is raycasting????
@Vercidium
11 ай бұрын
Affirmative