[openal] Attenuation Roll-Off problems (too silent)

Chris Robinson chris.kcat at gmail.com
Fri May 20 23:42:19 EDT 2022


On Friday, May 20, 2022 2:14:00 PM PDT Roland Plüss wrote:
> There is also something else I have troubles with which is connected 
> with this problem. To do distance sounds I have to manipulate the 
> attenuation calculation. To achieve this I tried disabling attenuation 
> on a per-sound basis by setting roll-off to 0 and setting the source 
> gain to my calculated attenuation. While this works for direct sound 
> path I get into troubles with EAX reverb gain. I simply can't figure out 
> if the EAX reverb gain is applied to the full volume source or to the 
> source with the source gain applied, hence which one is true?
> 
> 1) final reverb gain = source.gain * source.attenuation * reverb.gain
> 2) final reverb gain = source.gain * reverb.gain
> 3) final reverb gain = reverb.gain
> 
> The documentation does not state this. I would assume 1 to be true but 
> my experiments do not give me a usable answer.

For reverb, it starts with source.gain * reverb.gain. There is additional 
attenuation applied based on the sound distance and the reverb properties, 
although it's not the same as the distance attenuation applied to the direct 
path. This extra attenuation is a statistical model to simulate the kind of 
room path attenuation found in real environments. There doesn't seem to be 
much public information about this statistical model, so as far as OpenAL Soft 
is concerned, its had to come up with its own thing which may still need more 
tweaking, but the latest version should be better than older versions, at 
least.

There are source and reverb room rolloff properties which work like the 
source's direct path rolloff, but these are disabled by default (set to 0) 
since the statistical model is applied. You can disable that statistical model 
and use the room rolloff properties instead (set the auxiliary effect slot's 
AL_EFFECTSLOT_AUXILIARY_SEND_AUTO property to false, then set the source's 
AL_ROOM_ROLLOFF_FACTOR and/or reverb's AL_REVERB_ROOM_ROLLOFF_FACTOR as you 
want), but it's up to you to set them correctly.




More information about the openal mailing list