Improve environment suit sfx

Set AL_LOWPASS_GAIN like EAX did under the hood.
Set the same filter via AL_DIRECT_FILTER on sources.

This should bring the overall sfx closer to EAX:
<kaan_> it sounds awesome

All infos provided by KittyCat from #openal.
This commit is contained in:
dhewg 2012-01-11 19:01:19 +01:00
parent ad48afdbd7
commit 35bd70ea46

View file

@ -71,7 +71,12 @@ void idSoundWorldLocal::Init( idRenderWorld *renderWorld ) {
listenerFilter = AL_FILTER_NULL; listenerFilter = AL_FILTER_NULL;
} else { } else {
soundSystemLocal.alFilteri(listenerFilter, AL_FILTER_TYPE, AL_FILTER_LOWPASS); soundSystemLocal.alFilteri(listenerFilter, AL_FILTER_TYPE, AL_FILTER_LOWPASS);
// EAX occusion value was -1150; pow(10.0, -1150/2000.0) // original EAX occusion value was -1150
// default OCCLUSIONLFRATIO is 0.25
// pow(10.0, (-1150*0.25)/2000.0)
soundSystemLocal.alFilterf(listenerFilter, AL_LOWPASS_GAIN, 0.718208f);
// pow(10.0, -1150/2000.0)
soundSystemLocal.alFilterf(listenerFilter, AL_LOWPASS_GAINHF, 0.266073f); soundSystemLocal.alFilterf(listenerFilter, AL_LOWPASS_GAINHF, 0.266073f);
} }
} }
@ -1775,8 +1780,15 @@ void idSoundWorldLocal::AddChannelContribution( idSoundEmitterLocal *sound, idSo
#endif #endif
alSourcef( chan->openalSource, AL_PITCH, ( slowmoActive && !chan->disallowSlow ) ? ( slowmoSpeed ) : ( 1.0f ) ); alSourcef( chan->openalSource, AL_PITCH, ( slowmoActive && !chan->disallowSlow ) ? ( slowmoSpeed ) : ( 1.0f ) );
if (idSoundSystemLocal::useEFXReverb) if (idSoundSystemLocal::useEFXReverb) {
alSource3i(chan->openalSource, AL_AUXILIARY_SEND_FILTER, listenerSlot, 0, enviroSuitActive ? listenerFilter : AL_FILTER_NULL); if (enviroSuitActive) {
alSourcei(chan->openalSource, AL_DIRECT_FILTER, listenerFilter);
alSource3i(chan->openalSource, AL_AUXILIARY_SEND_FILTER, listenerSlot, 0, listenerFilter);
} else {
alSource3i(chan->openalSource, AL_AUXILIARY_SEND_FILTER, listenerSlot, 0, AL_FILTER_NULL);
}
}
if ( ( !looping && chan->leadinSample->hardwareBuffer ) || ( looping && chan->soundShader->entries[0]->hardwareBuffer ) ) { if ( ( !looping && chan->leadinSample->hardwareBuffer ) || ( looping && chan->soundShader->entries[0]->hardwareBuffer ) ) {
// handle uncompressed (non streaming) single shot and looping sounds // handle uncompressed (non streaming) single shot and looping sounds