aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-03-21 10:42:42 -0700
committerChris Robinson <[email protected]>2009-03-21 10:42:42 -0700
commitfc6d6b16012ca5d4ea12bf4f0fc88d8c86fe8c73 (patch)
tree3d530125514e06902a98903a6c4eaf20b1526ede
parent9306e36d526a6157e507d83fee6a35a539e4bc55 (diff)
Use the square of the values when calculating the density gain
-rw-r--r--Alc/alcReverb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c
index 30581ff0..91e60a8c 100644
--- a/Alc/alcReverb.c
+++ b/Alc/alcReverb.c
@@ -525,10 +525,10 @@ ALvoid VerbUpdate(ALCcontext *Context, ALeffectslot *Slot, ALeffect *Effect)
LATE_LINE_LENGTH[2] + LATE_LINE_LENGTH[3]);
g = length * (1.0f + LATE_LINE_MULTIPLIER) * 0.25f;
g = pow(10.0f, g * -60.0f / 20.0f);
- g = 1.0f / (1.0f - g);
+ g = 1.0f / (1.0f - (g*g));
length *= 1.0f + (Effect->Reverb.Density * LATE_LINE_MULTIPLIER) * 0.25f;
length = pow(10.0f, length / Effect->Reverb.DecayTime * -60.0f / 20.0f);
- length = 1.0f / (1.0f - length);
+ length = 1.0f / (1.0f - (length*length));
State->Late.DensityGain = 0.707106f * __min(aluSqrt(g / length), 1.0f);
// Calculate the all-pass feed-back and feed-forward coefficient.