From bf19186223d3b3cd684582b55868b58a0a0c2318 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 30 Sep 2011 17:51:21 -0700 Subject: Apply the initial wet send reverb decay before clamping the gains --- Alc/ALu.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Alc/ALu.c b/Alc/ALu.c index 9965e002..8f49ddd3 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -579,7 +579,24 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) AirAbsorptionFactor*EffectiveDist); } - //3. Apply directional soundcones + if(WetGainAuto) + { + /* Apply a decay-time transformation to the wet path, based on the + * attenuation of the dry path. + * + * Using the approximate (effective) source to listener distance, 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 */, + EffectiveDist / DecayDistance[i]); + } + } + + /* Calculate directional soundcones */ Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * (180.0f/F_PI); if(Angle >= InnerAngle && Angle <= OuterAngle) { @@ -626,23 +643,6 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) WetGainHF[i] *= ALSource->Send[i].WetGainHF; } - if(WetGainAuto) - { - /* Apply a decay-time transformation to the wet path, based on the - * attenuation of the dry path. - * - * Using the approximate (effective) source to listener distance, 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 */, - EffectiveDist / DecayDistance[i]); - } - } - // Calculate Velocity if(DopplerFactor != 0.0f) { -- cgit v1.2.3