by Chris » Sun Nov 28, 2021 8:18 pm
Sounds like a consequence of fixing this issue:
viewtopic.php?t=63524
Put simply, Doom's sound distance handling is odd and not physically accurate at all. Which is causing weird interactions with a portion of OpenAL's code that is based on (somewhat informed) guesswork.
The deal is this: reverb decays over time in an environment as a result of reflecting off of and being absorbed by surfaces. As you move away from a sound, it takes longer for the direct sound to reach you, with the reverb taking even longer while it reflects off surfaces during that time before ever reaching you. So as a sound moves into the distance, the amount of reverb you hear is implicitly reduced. Reverb engines implement this as a statistically modeled initial reverb decay that's applied based on the sound distance. Of course, commercial implementations, like you'd find on hardware cards or FMOD, are proprietary (closed source "secrets", or restrictively licensed), so OpenAL Soft has to make something itself that seems close enough to what apps would expect with other implementations. The method employed works by taking the distance between the sound sound and listener, the speed of sound, and the reverb decay rate, and applies an initial decay given how much time would've passed for the direct sound to reach the listener. While this seems fairly close, there could well be differences when considering various edge and corner cases, particularly given Doom's inaccurate sound distance modeling. It's also possible a similar thing would happen with FMOD, it's just been so long since (G)ZDoom used it that it's not obvious.
There are ways of handling with this, though. An app can toggle off this automatic rolloff and calculate its own (or no) initial decay given the sound distance. It can also apply an initial reverb decay that's based on the distance attenuation of the dry sound. Given the aforementioned bug report, having no initial decay would be wrong. So if the default automatic decay is also not good, another method needs to be chosen. Either an initial decay that's based on the distance attenuation (not accurate, but maybe an acceptable compromise) or a custom calculation.
Sounds like a consequence of fixing this issue:
viewtopic.php?t=63524
Put simply, Doom's sound distance handling is odd and not physically accurate at all. Which is causing weird interactions with a portion of OpenAL's code that is based on (somewhat informed) guesswork.
The deal is this: reverb decays over time in an environment as a result of reflecting off of and being absorbed by surfaces. As you move away from a sound, it takes longer for the direct sound to reach you, with the reverb taking even longer while it reflects off surfaces during that time before ever reaching you. So as a sound moves into the distance, the amount of reverb you hear is implicitly reduced. Reverb engines implement this as a statistically modeled initial reverb decay that's applied based on the sound distance. Of course, commercial implementations, like you'd find on hardware cards or FMOD, are proprietary (closed source "secrets", or restrictively licensed), so OpenAL Soft has to make something itself that seems close enough to what apps would expect with other implementations. The method employed works by taking the distance between the sound sound and listener, the speed of sound, and the reverb decay rate, and applies an initial decay given how much time would've passed for the direct sound to reach the listener. While this seems fairly close, there could well be differences when considering various edge and corner cases, particularly given Doom's inaccurate sound distance modeling. It's also possible a similar thing would happen with FMOD, it's just been so long since (G)ZDoom used it that it's not obvious.
There are ways of handling with this, though. An app can toggle off this automatic rolloff and calculate its own (or no) initial decay given the sound distance. It can also apply an initial reverb decay that's based on the distance attenuation of the dry sound. Given the aforementioned bug report, having no initial decay would be wrong. So if the default automatic decay is also not good, another method needs to be chosen. Either an initial decay that's based on the distance attenuation (not accurate, but maybe an acceptable compromise) or a custom calculation.