Jump to content


Incorrect EFX environment size handling

efx reverb openal

  • Please log in to reply
1 reply to this topic

#1 KCat



  • Member
  • Pip
  • 8 posts

Posted 08 February 2018 - 04:49 AM

Wasn't sure the best way to report or fix this is, but as I was recently trying to build TDM from the SVN source to get OpenAL sound output on Linux with reverb (the latest release doesn't seem to have it), and noticed a small issue in the source. In sound/snd_efxfile.cpp, there is this line which converts the "environment size" preset property to density:
efxf(AL_EAXREVERB_DENSITY, (size < 2.0f) ? (size - 1.0f) : 1.0f);
That's incorrect. The correct way to convert it, based on Creative's own EAX-to-EFX conversion tools and as adopted by the Dhewm3 port, is:
float size = src.ParseFloat();
efxf(AL_EAXREVERB_DENSITY, idMath::ClampFloat(
        idMath::Pow(size, 3.0f) * 0.0625f
This will help improve the quality of the reverb, making the presets sound closer to the intended response.
Hope that's helpful. :)

Edited by KCat, 08 February 2018 - 04:51 AM.

  • Judith, HMart and Anderson like this

#2 grayman


    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12284 posts

Posted 08 February 2018 - 06:22 AM

Welcome, KCat, and thank you for your post.


Someone familiar with the EFX code should be along shortly to deal with this.

Also tagged with one or more of these keywords: efx, reverb, openal

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users