Set reverb density based on the environment size

This commit is contained in:
Chris Robinson 2014-07-15 23:04:53 -07:00
parent 1aaaac900d
commit d43226631d

View file

@ -1840,6 +1840,7 @@ void OpenALSoundRenderer::LoadReverb(const ReverbContainer *env)
#undef SETPARAM #undef SETPARAM
#define SETPARAM(e,t,v) alEffectf((e), AL_EAXREVERB_##t, clamp((v), AL_EAXREVERB_MIN_##t, AL_EAXREVERB_MAX_##t)) #define SETPARAM(e,t,v) alEffectf((e), AL_EAXREVERB_##t, clamp((v), AL_EAXREVERB_MIN_##t, AL_EAXREVERB_MAX_##t))
SETPARAM(*envReverb, DIFFUSION, props.EnvDiffusion); SETPARAM(*envReverb, DIFFUSION, props.EnvDiffusion);
SETPARAM(*envReverb, DENSITY, powf(props.EnvSize, 3.0f) * 0.0625f);
SETPARAM(*envReverb, GAIN, mB2Gain(props.Room)); SETPARAM(*envReverb, GAIN, mB2Gain(props.Room));
SETPARAM(*envReverb, GAINHF, mB2Gain(props.RoomHF)); SETPARAM(*envReverb, GAINHF, mB2Gain(props.RoomHF));
SETPARAM(*envReverb, GAINLF, mB2Gain(props.RoomLF)); SETPARAM(*envReverb, GAINLF, mB2Gain(props.RoomLF));
@ -1868,6 +1869,7 @@ void OpenALSoundRenderer::LoadReverb(const ReverbContainer *env)
{ {
#define SETPARAM(e,t,v) alEffectf((e), AL_REVERB_##t, clamp((v), AL_REVERB_MIN_##t, AL_REVERB_MAX_##t)) #define SETPARAM(e,t,v) alEffectf((e), AL_REVERB_##t, clamp((v), AL_REVERB_MIN_##t, AL_REVERB_MAX_##t))
SETPARAM(*envReverb, DIFFUSION, props.EnvDiffusion); SETPARAM(*envReverb, DIFFUSION, props.EnvDiffusion);
SETPARAM(*envReverb, DENSITY, powf(props.EnvSize, 3.0f) * 0.0625f);
SETPARAM(*envReverb, GAIN, mB2Gain(props.Room)); SETPARAM(*envReverb, GAIN, mB2Gain(props.Room));
SETPARAM(*envReverb, GAINHF, mB2Gain(props.RoomHF)); SETPARAM(*envReverb, GAINHF, mB2Gain(props.RoomHF));
SETPARAM(*envReverb, DECAY_TIME, props.DecayTime); SETPARAM(*envReverb, DECAY_TIME, props.DecayTime);