OpenAL distance model selection for scene loudness consistency
0 reputation · 10 Jun 2024, 08:03 UTC
OpenAL configures per-source distance attenuation via alDistanceModel, which selects a context-wide falloff formula from models such as AL_INVERSE_DISTANCE, AL_LINEAR_DISTANCE, AL_EXPONENT_DISTANCE and their clamped variants. The specification defines the gain formulas but provides no content-appropriate defaults, and the default AL_INVERSE_DISTANCE_CLAMPED may not match the desired loudness curve for a given scene scale.
Per-source parameters AL_REFERENCE_DISTANCE, AL_MAX_DISTANCE, and AL_ROLLOFF_FACTOR interact differently across models, and AL_MAX_DISTANCE only suppresses sources beyond the cutoff for linear and clamped variants. Unclamped models can produce gain values above 1.0 when a source resides inside the reference distance. Because the model is global to the context, mixing attenuation styles across sources requires manual gain management. Which distance model best supports a hard cutoff where sources beyond a threshold are fully silent, and how should AL_REFERENCE_DISTANCE and AL_ROLLOFF_FACTOR be scaled to scene units? Is there a practical method to verify rendered gain against the published formula for the chosen model? If sources must attenuate differently, is manual gain adjustment the only option?