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

  • @pardontheopinion8679
    @pardontheopinion86792 жыл бұрын

    Verc makes a game, and just casually makes one of the best audio systems I've ever seen. What the hell

  • @Vercidium

    @Vercidium

    2 жыл бұрын

    Haha thank you so much!

  • @Hinge45
    @Hinge452 жыл бұрын

    imagine if this is a standard for all games. they keep improving the visuals but no one is imrpoving the audio.

  • @presidentgamingz
    @presidentgamingz3 ай бұрын

    Imagine locking up someone and hearing their muffled scream. This better be in GTA 6

  • @Realkill_
    @Realkill_2 жыл бұрын

    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

    @Vercidium

    2 жыл бұрын

    Can't wait! I'll add sound sources to the map JSON format

  • @TotallyPorff
    @TotallyPorff2 жыл бұрын

    Damn this makes me want a Boombox as equipment so I can blast some tunes around the map 😂

  • @Vercidium

    @Vercidium

    2 жыл бұрын

    Haha that would be sick, +2 Loadout Style

  • @pardontheopinion8679

    @pardontheopinion8679

    Жыл бұрын

    And 10 months later, this is common in game. =)

  • @idedary
    @idedary8 ай бұрын

    Man, you are absolute chad. Can't wait to dabble in this approach myself :D

  • @minecat1839
    @minecat18396 ай бұрын

    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.

  • @niccolocampese9289
    @niccolocampese92892 жыл бұрын

    This looks insane, phenomenal job.

  • @JJ-fc2ho
    @JJ-fc2ho2 жыл бұрын

    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

    @JJ-fc2ho

    2 жыл бұрын

    Also this opens up a whole new world for materials. Imagine making sound parameters for materials in blender with nodes.

  • @Vercidium

    @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

  • @BSEUNHIR
    @BSEUNHIR2 жыл бұрын

    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.

  • @aachoosenpai5013
    @aachoosenpai50132 жыл бұрын

    Yo dis be insaneeeee 🎉🎉 Keep it up man

  • @Vercidium

    @Vercidium

    2 жыл бұрын

    Thank you!

  • @randomisedrandomness
    @randomisedrandomness8 ай бұрын

    Nice! I had an idea like this some time ago. I thought it would be good for realistic gun sounds.

  • @Ni7ram
    @Ni7ram7 ай бұрын

    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

    @Vercidium

    7 ай бұрын

    Great point! I've since enabled HRTF and the difference is night and day

  • @pobillibrari
    @pobillibrari2 ай бұрын

    Incredible

  • @FromLake
    @FromLake8 ай бұрын

    very inspiring

  • @nxtboyIII
    @nxtboyIII2 жыл бұрын

    sick

  • @teroblepuns
    @teroblepuns2 жыл бұрын

    This is exactly what I was looking

  • @kwcnasa
    @kwcnasa6 ай бұрын

    This should be in all FPS game, at least in CS2

  • @zennon_youtube
    @zennon_youtube8 ай бұрын

    My mind is blown

  • @antydagames
    @antydagames2 жыл бұрын

    Yes! This is great work! Is the raycasting expensive? There sure are a lot!

  • @pyropulseIXXI
    @pyropulseIXXI3 ай бұрын

    Needs some diffraction, so hearing around corners should be slightly louder Regardless, this is an impressive audio system.

  • @Vercidium

    @Vercidium

    3 ай бұрын

    Thank you, great feedback

  • @kevinfischer4869
    @kevinfischer48692 жыл бұрын

    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

    @Vercidium

    2 жыл бұрын

    Thanks! The audio quality isn’t as great on KZread but the lower frequencies penetrate through when you’re isolated.

  • @blainemobius2697
    @blainemobius26976 ай бұрын

    Do you limit the speed of the audio rays? Like if there is an explosion that happens kinda far away?

  • @Vercidium

    @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

  • @shadowlordalpha
    @shadowlordalpha5 күн бұрын

    really does need to use both ears at all times, seems to use one or the other a bit to much

  • @starryeyes5860
    @starryeyes58607 ай бұрын

    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

    @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

    @starryeyes5860

    6 ай бұрын

    that is honestly so cool. super easy to understand explanation, thank you for the reply! Such an interesting technology.

  • @timeSlidrGaming
    @timeSlidrGaming2 жыл бұрын

    How come AAA games aren't doing this? Is it super resource intensive?

  • @Vercidium

    @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

    @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

    @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.

  • @philippwende8220
    @philippwende82206 ай бұрын

    is the sound actually delayed according to the "Path" of the sound? What i'm trying to ask is: Are Echos possible?

  • @Vercidium

    @Vercidium

    6 ай бұрын

    It’s not delayed, OpenAL Soft is used to add reverb effects to sounds

  • @dazyalaska8713
    @dazyalaska8713Ай бұрын

    I wonder if my low end pc could run this.

  • @zachariahm.kemper7406
    @zachariahm.kemper740610 ай бұрын

    Was this made with unity, godot, unreal or did you make it in something else

  • @Vercidium

    @Vercidium

    10 ай бұрын

    Hey this is a custom engine made with C# and OpenGL

  • @3DJ
    @3DJ2 жыл бұрын

    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

    @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

    @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

    @Vercidium

    2 жыл бұрын

    @@3DJ sure thing, thank you! Send me a friend request

  • @narcis451
    @narcis4514 ай бұрын

    Зумеры изобрели EAX:

  • @RogueBeatsARG
    @RogueBeatsARG8 ай бұрын

    sounds kinda wierd withouth Binaural Audio

  • @Vercidium

    @Vercidium

    8 ай бұрын

    Yeah HRTF wasn’t in use at this point

  • @beshkekart3909
    @beshkekart39092 жыл бұрын

    matrix xd

  • @danieljin9301
    @danieljin930111 ай бұрын

    this is raycasting????

  • @Vercidium

    @Vercidium

    11 ай бұрын

    Affirmative

Келесі