aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-03-18 08:06:21 -0700
committerChris Robinson <[email protected]>2012-03-18 08:06:21 -0700
commit2d0e0289939d28d1da38600178eb107a9cdbc320 (patch)
treeec018f5c09ced16bfe0cb052b098d70214fcaed7
parent703d72f20e6e941a2438de188ebda0b08850c112 (diff)
Base the initial reverb decay on the source's dry path attenuation
-rw-r--r--Alc/ALu.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index d3e16700..c868ad2f 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -571,19 +571,21 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
AirAbsorptionFactor*ClampedDist);
}
- if(WetGainAuto && ClampedDist > 0.0f)
+ if(WetGainAuto)
{
+ ALfloat ApparentDist = 1.0f/maxf(Attenuation, 0.00001f) - 1.0f;
+
/* Apply a decay-time transformation to the wet path, based on the
* attenuation of the dry path.
*
- * Using the distance from the minimum (reference) distance property,
- * the initial decay of the reverb effect is calculated and applied to
- * the wet path.
+ * Using the apparent distance, based on the distance attenuation, the
+ * initial decay of the reverb effect is calculated and applied to the
+ * wet path.
*/
for(i = 0;i < NumSends;i++)
{
if(DecayDistance[i] > 0.0f)
- WetGain[i] *= aluPow(0.001f/*-60dB*/, ClampedDist/DecayDistance[i]);
+ WetGain[i] *= aluPow(0.001f/*-60dB*/, ApparentDist/DecayDistance[i]);
}
}