aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-11-15 04:11:22 -0800
committerChris Robinson <[email protected]>2014-11-15 04:11:22 -0800
commitb10085cc63e9f66807174880a346948c0e5ab3ed (patch)
treebcce36fee8172d18adcd9d1407361390eff81300 /Alc
parent9681c5a2bb495aeaa9f38a5621ffe020927df53a (diff)
Slightly increase the ambient gain volume
Diffstat (limited to 'Alc')
-rw-r--r--Alc/panning.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Alc/panning.c b/Alc/panning.c
index 57df2c6f..f0adcbcc 100644
--- a/Alc/panning.c
+++ b/Alc/panning.c
@@ -86,7 +86,14 @@ void ComputeAmbientGains(const ALCdevice *device, ALfloat ingain, ALfloat gains[
for(i = 0;i < MAX_OUTPUT_CHANNELS;i++)
gains[i] = 0.0f;
for(i = 0;i < device->NumChannels;i++)
- gains[i] = device->Channel[i].HOACoeff[0] * ingain;
+ {
+ // The W coefficients are based on a mathematical average of the
+ // output, scaled by sqrt(2) to compensate for FuMa-style Ambisonics
+ // scaling the W channel input by sqrt(0.5). The square root of the
+ // base average provides for a more perceptual average volume, better
+ // suited to non-directional gains.
+ gains[i] = sqrtf(device->Channel[i].HOACoeff[0]/1.4142f)*1.4142f * ingain;
+ }
}
void ComputeBFormatGains(const ALCdevice *device, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])