After the last post where I talked about adding spatialised sounds – that is, sounds that feel like they exist in a two- or three-dimensional world – I continued looking into adding reverb to the sounds, to make the game world sound more real and alive.

Originally I thought the best solution would be to pre-compose sounds with reverb at different distances, but because the game camera can move so fluidly, it didn’t work. If you moved the camera, sounds became choppy and uncomfortable.

So I’m happy to have come up with a solution using the native OpenAL bindings, where I can add any number of filters and effects to playing sounds:

Demoing full sound spatializaton (best experienced with headphones)

Along the way I also needed to upgrade the engine, and I’ve learned a lot more about sound effects and native bindings 😂

(For the curious, this is some prototyping code that implements the effect. I’d love to open source this as a library one day.)