diff options
author | Chris Robinson <[email protected]> | 2017-01-21 11:54:22 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-01-21 11:54:22 -0800 |
commit | 7025660e8be552a4784913e910b9bd65740c1427 (patch) | |
tree | 92770991c650a1f9ef463f05d970c1e0804c9698 | |
parent | 371fda1803378b83bc3a354a89c8326b21bb8be0 (diff) |
Use a flat sqrt(2) scale for non-directional ambient gains
-rw-r--r-- | Alc/panning.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Alc/panning.c b/Alc/panning.c index ba7a38db..c263a20e 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -214,12 +214,7 @@ void ComputeAmbientGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, AL ALsizei i; for(i = 0;i < numchans;i++) - { - // The W coefficients are based on a mathematical average of the - // output. The square root of the base average provides for a more - // perceptual average volume, better suited to non-directional gains. - gains[i] = sqrtf(chancoeffs[i][0]) * ingain; - } + gains[i] = chancoeffs[i][0] * 1.414213562f * ingain; for(;i < MAX_OUTPUT_CHANNELS;i++) gains[i] = 0.0f; } @@ -465,8 +460,8 @@ static bool MakeSpeakerMap(ALCdevice *device, const AmbDecConf *conf, ALuint spe static const ChannelMap MonoCfg[1] = { { FrontCenter, { 1.0f } }, }, StereoCfg[2] = { - { FrontLeft, { 5.00000000e-1f, 2.88675135e-1f, 0.0f, 0.0f } }, - { FrontRight, { 5.00000000e-1f, -2.88675135e-1f, 0.0f, 0.0f } }, + { FrontLeft, { 5.00000000e-1f, 2.88675135e-1f, 0.0f, 0.00000000e+0f } }, + { FrontRight, { 5.00000000e-1f, -2.88675135e-1f, 0.0f, 0.00000000e+0f } }, }, QuadCfg[4] = { { BackLeft, { 3.53553391e-1f, 2.04124145e-1f, 0.0f, -2.04124145e-1f } }, { FrontLeft, { 3.53553391e-1f, 2.04124145e-1f, 0.0f, 2.04124145e-1f } }, |