KozGit / DOOM-3-BFG-VR

Doom 3 BFG VR: Fully Possessed. Doom 3 BFG with native Oculus Rift/Touch or OpenVR support
GNU General Public License v3.0
370 stars 52 forks source link

OpenAL support on windows? #347

Open phobos2077 opened 3 years ago

phobos2077 commented 3 years ago

Trying this on Rift S on Windows 10. The positional audio is horrible... I have an HRTF profile I use for every game that supports OpenAL32. The readme says it's supported but in reality it doesn't seem to load OpenAL32.dll at all.

Maybe there's some config parameter to switch OpenAL on?

phobos2077 commented 3 years ago

Damn, looks like the engine needs to be re-compiled to enable OpenAL... Maybe somebody did it already?

NPi2Loup commented 3 years ago

I can rebuild the project : I already done a release with the pending works of KozGit & Carl : https://github.com/NPi2Loup/DOOM-3-BFG-VR/releases

I don't how to enable OpenAL32, did you know how to do that ? Just a OpenAl as dependency and rebuild ? or it need some code update to the sound system ?

It seems that OpenAL isn't supported look at this : https://steamcommunity.com/app/208200/discussions/0/604941528482883388/

phobos2077 commented 3 years ago

I can rebuild the project : I already done a release with the pending works of KozGit & Carl : https://github.com/NPi2Loup/DOOM-3-BFG-VR/releases

I don't how to enable OpenAL32, did you know how to do that ? Just a OpenAl as dependency and rebuild ? or it need some code update to the sound system ?

It seems that OpenAL isn't supported look at this : https://steamcommunity.com/app/208200/discussions/0/604941528482883388/

If you check the readme, OpenAL is mentioned there:

OpenAL Soft sound backend primarily developed for Linux but works on Windows as well

From the CMake code it looks like all you need is to enable USE_OPENAL option. Or if you're using MSVC just uncomment this line and see what happens: https://github.com/KozGit/DOOM-3-BFG-VR/blob/0df0e24ff49ae9525c3b971c156795ad2b69afd8/neo/CMakeLists.txt#L181

I just haven't done any C++ development for a while and don't have all the various SDKs installed, was hoping someone closer to the project can do it.

OpenAL is awesome for VR because it has HRTF support which is a game changer for immersion! I just don't understand why I'm the first one to ask for this. Seems like that's the best way to play games in VR!

I did try this lib that supposed to add HRTF to any game using XAudio https://github.com/kosumosu/x3daudio1_7_hrtf, but it just doesn't work for whatever reason.

NPi2Loup commented 3 years ago

You may try this one, I enabled OPENAL and I see OpenAL .h files in project depencencies, so it may work :)

It's my 021g version with OpenAL enabled (I can't see any differences, but I very poor at audio sensibility) Check you installed the full release first, then replace exe : https://github.com/NPi2Loup/DOOM-3-BFG-VR/releases

Doom3BFGVR 021g-openAl.zip

Kaan88 commented 3 years ago

I have noticed the lack of good positional audio too, especially after Doom 3 VR was released for Quest which is based on dhewm3 I believe. This one has eax support and it was easier to tell where the monsters were, plus some cool reverb effects.

Anyway, I just tried you build and didn't notice any difference. Any chance for EAX support? https://github.com/MadDeCoDeR/Classic-RBDOOM-3-BFG They seem to have added support for it.

NPi2Loup commented 3 years ago

The original Doom3 have a very little support to 3D sound (https://forum.beyond3d.com/threads/doom-3-sound-headphones-directsound3d.15098/) Others mods may have add it, and it's beyond what I can do. (may @KozGit or @CarlKenner hear you )

Its seems that EAX support doesn't meen good 3D positioning. I found this comment in a video about RBDOOM : (https://www.youtube.com/watch?v=ZmaCAYfcEkY&ab_channel=Mr.GK)

Wrong. Real EAX effects (reverbs, occlusion, etc.) are perfectly pkayable over headphones (CMSS) and a real surround setup. This mod uses OpenAL Soft which can't make complete eax effects. Many people uses OpenAL Soft to downmix original OpenAL and DirectSound games with some HRTF for headphones. EAX is more than that.

This VR mod use OpenAL-soft too (but dhewm3 too, so may be possible)

phobos2077 commented 3 years ago

The cool thing with games using OpenAL is that you can just upgrade to the latest version by simply placing a newer DLL into the game folder, and enjoy new features such as HRTF and some form of software EAX replacement they added (don't remember the details). I've played through many older games with hand-picked HRTF profile that fits my head shape - highly recommend. After buying my first VR headset last year I was surprised there's so little conversation about HRTF. I think SOME (non-OpenAL) games might have their own implementation, but you can't get the same effect with generic profiles because and I haven't seen any options to choose HRTF profiles in any game. Seems like a huge missed opportunity for VR gaming. I hope it will catch on in future.

phobos2077 commented 3 years ago

@NPi2Loup The exe you compiled still links to XAudio DLLs so it doesn't use OpenAL. I checked via Process Explorer.

NPi2Loup commented 3 years ago

ok, will try do rebuild... how do you check ? it's runtime or analyze of the exe ?

phobos2077 commented 3 years ago

@NPi2Loup I use this tool: https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer

Also I have the following environment variables set up so OpenAL logs everything it's doing. If log haven't changed after running the game - means it didn't use OpenAL.

изображение