mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Clamp attenuation zone coefficients to a more reasonable limit of -60dB per doubling of distance
This commit is contained in:
parent
328809f008
commit
7cade1e354
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue