diff options
author | Chris Robinson <[email protected]> | 2009-12-10 18:37:36 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-12-10 18:37:36 -0800 |
commit | 56cc03860378e2758370b773b2a6f1b4e086b49a (patch) | |
tree | 052977e85ad193a8099423542e877f2f6b6bf965 /Alc/ALu.c | |
parent | 4c83c689a803f3b0186f96d893d7ed903ce2c456 (diff) |
Improve initial decay calculations for sends to reverb
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -746,19 +746,16 @@ static ALvoid CalcSourceParams(const ALCcontext *ALContext, ALsource *ALSource) Slot->effect.type == AL_EFFECT_EAXREVERB) { /* Apply a decay-time transformation to the wet path, - * based on the attenuation of the dry path. This should - * better approximate the statistical attenuation model - * for the reverb effect. + * based on the attenuation of the dry path. * - * This simple equation converts the distance attenuation - * into the time it would take to reach -60 dB. From - * there it establishes an origin (0.333s; the decay time - * that will produce equal attenuation) and applies the - * current decay time. Finally, it converts the result - * back to an attenuation for the reverb path. + * Using the approximate (effective) source to listener + * distance, the initial decay of the reverb effect is + * calculated and applied to the wet path. */ - WetGain[i] *= pow(10.0f, log10(flAttenuation) * 0.333f / - Slot->effect.Reverb.DecayTime); + WetGain[i] *= pow(10.0, effectiveDist / + (SPEEDOFSOUNDMETRESPERSEC * + Slot->effect.Reverb.DecayTime) * + -60.0 / 20.0); WetGainHF[i] *= pow(10.0, log10(Slot->effect.Reverb.AirAbsorptionGainHF) * |