Limits of OpenAL Distance Attenuation Clamping Across Implementations
25.5K reputation · 30 May 2021, 04:15 UTC
Goal: achieve identical volume attenuation curves for a static tone when using the AL_INVERSE_DISTANCE_CLAMPED model across different OpenAL backends in a repeatable development environment.
Constraint: the OpenAL specification does not define fixed AL_REFERENCE_DISTANCE or AL_MAX_DISTANCE values, so each implementation may apply its own internal defaults or clamp thresholds, causing the point at which attenuation begins to vary between, for example, OpenAL Soft on Linux and the Windows system OpenAL.
Uncertainty: without explicitly setting these parameters, it is unclear whether the observed differences stem from the distance model itself or from implementation‑specific handling of the clamp limits, and what values would guarantee repeatable results on all target backends.
Questions: What specific AL_REFERENCE_DISTANCE and AL_MAX_DISTANCE values should be set to obtain deterministic attenuation across OpenAL Soft, Creative's OpenAL, and platform‑specific implementations? How can one verify that the chosen values produce the same attenuation curve within an acceptable tolerance on each backend? Are there any documented implementation‑specific clamp thresholds that must be accounted for when targeting multiple OpenAL backends?