OpenAL EFX Effects

Feedback on past, current, and future development.
Post Reply
Epoch
Posts: 3
Joined: 07 Aug 2022, 23:47
Gitlab profile: https://gitlab.com/EpicWN1337

OpenAL EFX Effects

Post by Epoch »

Right now OpenMW only uses reverb when under water. OpenAL EFX has support for a whole plethora of audio effects. Is there a possibility for reverb support? It can start basic with simply tagging a cell as a reverb value and any audio in that cell uses that value. A more complex system would be audio volumes with their own audio effect settings that could be placed in the CS (like how it's handled in Skyrim). With an audio volume system someone would have to go in and add volumes for the base game if you want the functionality out of the box, or leave it up to modders. Further down the line support could be added for audio occlusion (as a tag in CS for placed sounds to allow ambient sounds to function) or even add an audio material system based on texture or a tag on the model.

Another possibility that I don't believe is supported out of the box with OpenAL (based on skimming the documentation) would be some sort of realtime audio system that determines the scale of a room or area and calculates the reverb value based on that, but that would be much more complex to implement, probably best left to modders if such a system would be possible with just mods.

I don't know the extent that would be required to add a reverb system, but doppler could be added as a basic flag that you can switch in settings.

With even just the HRTF as of now, the game sounds incredible, I just feel that leaning in to the full extent of OpenAL could drastically improve the game's audio beyond what was possible in the original.

https://www.youtube.com/watch?v=OgO630WNudc
This is someone using software drivers to force enable EAX reverb on Morrowind, the game doesn't support reverb so it uses a uniform value everywhere. Even though its not intended, it shows how much reverb can add to the atmosphere of the game. I wish I had the programming ability to get this working in OpenMW, but sadly I don't.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: OpenAL EFX Effects

Post by Chris »

Epoch wrote: 08 Aug 2022, 00:03 Another possibility that I don't believe is supported out of the box with OpenAL (based on skimming the documentation) would be some sort of realtime audio system that determines the scale of a room or area and calculates the reverb value based on that
It's somewhat possible. OpenAL/EFX allows you to dynamically adjust the delay, direction/spread, and gain of the early reflections and late reverbation, so it's completely possible for the game to do "visibility" checks from the listener to the surrounding surfaces, and set the delay, direction/spread, and gain of the early reflections based on the distance and direction to the nearest walls, and set the delay, direction/spread, and gain of the late reverberation based on the listener's position relative to the main environment. These properties should ideally be updated around 30 times a second (there's no real need to do it faster to maintain a convincing audio scene).

All other reverb parameters can also be adjusted dynamically (based on whatever criteria you want, such as using prefab environment sectors/cells, or real-time area analysis), though it's suggested to update these other properties less frequently (around 15 times a second at most). It's also possible to have multiple active reverbs, keeping track of the nearest environments and the apertures connecting the environments.

This is discussed somewhat in the Effects Extension Guide, under the sections for "Multi-Environment Modeling" and "Dynamic Modelling". The PDF has many other things worth reading for doing environmental reverb.
Epoch wrote: 08 Aug 2022, 00:03 With even just the HRTF as of now, the game sounds incredible, I just feel that leaning in to the full extent of OpenAL could drastically improve the game's audio beyond what was possible in the original.
Though probably much less relevant these days, OpenAL Soft can also do UHJ output, which is essentially an improved version of ProLogic II. It encodes a full circle surround sound into stereo output (as opposed to discrete 5.1 or 7.1 channels like ProLogic, UHJ handles a continuous circle of surround sound), which provides a more stable and wider stereo sound when listened to as-is, and can optionally be decoded for surround sound playback. In fact, a ProLogic-compatible decoder can decode a UHJ signal to surround sound (but a native UHJ decoder can do a better job).

Though in any case, there's not too much reason to use OpenAL Soft's UHJ output instead of normal surround sound or HRTF output, unless you have a proper surround sound receiver and can only use stereo output, which is probably really rare. Where it would be more useful is in situations where you're restricted to stereo, like a youtube video or streaming, and don't want to require headphones for your watchers.

Relatedly, starting with OpenAL Soft 1.22, there's support for UHJ input buffers too, so if you want to have surround sound music or video with only two audio channels, that could be something to add support for. There's also a Super Stereo option that can improve normal stereo sounds/music playing with surround sound or HRTF output.
Epoch
Posts: 3
Joined: 07 Aug 2022, 23:47
Gitlab profile: https://gitlab.com/EpicWN1337

Re: OpenAL EFX Effects

Post by Epoch »

OpenAL/EFX allows you to dynamically adjust the delay, direction/spread, and gain of the early reflections and late reverbation, so it's completely possible for the game to do "visibility" checks from the listener to the surrounding surfaces, and set the delay, direction/spread, and gain of the early reflections based on the distance and direction to the nearest walls, and set the delay, direction/spread, and gain of the late reverberation based on the listener's position relative to the main environment.
There is a mod for GZDoom that functions in a manner similar to this, by firing a basic ray cast to determine room size and such. It's probably a lot cheaper to do in a 2.5d engine like doom than in a fully 3d engine like OpenMW, but with audio you don't really need extremely precise details.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: OpenAL EFX Effects

Post by Chris »

Epoch wrote: 09 Aug 2022, 07:01 There is a mod for GZDoom that functions in a manner similar to this, by firing a basic ray cast to determine room size and such.
That's actually a bit simpler. It periodically fires some basic ray casts (once or twice a second) and selects one of a handful of presets using the average distance each ray traveled. It's not dynamically adjusting the gain/delay/direction/spread of the early reflections using the distance and direction to the nearest walls or the late reverb using the general room.
Post Reply