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

Chris Robinson chris.kcat at gmail.com
Mon May 23 23:14:56 EDT 2022


On 5/22/22 14:20, Roland Plüss wrote:
> So what settings would you use then? Increasing the volume or the 
> reference distance? I have the impression increasing the reference 
> distance leaves you with a sudden drop of volume out of the blue at the 
> distance border.

Both will drop volume at the same rate given a rolloff factor of 1. The 
calculation is effectively:

attenuation = ref_distance / ((distance - ref_distance)*rolloff_factor +
                               ref_distance)
mix_gain = clamp(attenuation * source_gain, min_gain, max_gain) *
            listener_gain;

(with appropriate protections against dividing by 0 and attenuation 
going negative). I suppose I would go with adjusting the reference 
distance if I had to pick blindly, though it's best if you know how the 
sound was authored and set both source properties properly.


More information about the openal mailing list