mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-01-19 16:00:52 +00:00
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:
parent
ad48afdbd7
commit
35bd70ea46
1 changed files with 15 additions and 3 deletions
|
@ -71,7 +71,12 @@ void idSoundWorldLocal::Init( idRenderWorld *renderWorld ) {
|
|||
listenerFilter = AL_FILTER_NULL;
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -1775,8 +1780,15 @@ void idSoundWorldLocal::AddChannelContribution( idSoundEmitterLocal *sound, idSo
|
|||
#endif
|
||||
alSourcef( chan->openalSource, AL_PITCH, ( slowmoActive && !chan->disallowSlow ) ? ( slowmoSpeed ) : ( 1.0f ) );
|
||||
|
||||
if (idSoundSystemLocal::useEFXReverb)
|
||||
alSource3i(chan->openalSource, AL_AUXILIARY_SEND_FILTER, listenerSlot, 0, enviroSuitActive ? listenerFilter : AL_FILTER_NULL);
|
||||
if (idSoundSystemLocal::useEFXReverb) {
|
||||
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 ) ) {
|
||||
// handle uncompressed (non streaming) single shot and looping sounds
|
||||
|
|
Loading…
Reference in a new issue