diff options
-rw-r--r-- | Alc/ALu.c | 12 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 2 |
2 files changed, 2 insertions, 12 deletions
@@ -537,17 +537,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) // Distance-based air absorption if(AirAbsorptionFactor > 0.0f && EffectiveDist > 0.0f) - { - ALfloat absorb; - - // Absorption calculation is done in dB - absorb = (AirAbsorptionFactor*AIRABSORBGAINDBHF) * - EffectiveDist; - // Convert dB to linear gain before applying - absorb = aluPow(10.0f, absorb/20.0f); - - DryGainHF *= absorb; - } + DryGainHF *= aluPow(AIRABSORBGAINHF, AirAbsorptionFactor*EffectiveDist); //3. Apply directional soundcones Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * (180.0/M_PI); diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 5a5bbd93..7ed9c636 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -210,7 +210,7 @@ extern "C" { #define DEFAULT_OUTPUT_RATE (44100) #define SPEEDOFSOUNDMETRESPERSEC (343.3f) -#define AIRABSORBGAINDBHF (-0.05f) +#define AIRABSORBGAINHF (0.99426) /* -0.05dB */ #define LOWPASSFREQCUTOFF (5000) |