Clamp attenuation zone coefficients to a more reasonable limit of -60dB per doubling of distance

This commit is contained in:
Ken Cooke 2019-01-16 12:16:20 -08:00
parent 328809f008
commit 7cade1e354

View file

@ -771,7 +771,8 @@ float computeGain(float masterListenerGain, const AvatarAudioStream& listeningNo
}
}
// translate the zone setting to gain per log2(distance)
float g = glm::clamp(1.0f - attenuationPerDoublingInDistance, EPSILON, 1.0f);
const float MIN_ATTENUATION_COEFFICIENT = 0.001f; // -60dB per log2(distance)
float g = glm::clamp(1.0f - attenuationPerDoublingInDistance, MIN_ATTENUATION_COEFFICIENT, 1.0f);
// calculate the attenuation using the distance to this node
// reference attenuation of 0dB at distance = ATTN_DISTANCE_REF