New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PannerNode.refDistance shouldn't throw when it's set to 0. #1105
Comments
First, I would say WebAudio is not OpenAL, but it is certainly inspired by OpenAL. It's probably possible to give definite meanings for all of these distance models, but does anyone actually use a ref distance of 0? |
OpenAL and linear model works well for 2D games. In case of removing |
I'm not really opposed to reverting this change. Just now need to come up with appropriate formulas for the corner cases for the inverse and exponential models. And since you found this, it seems clear that someone sets refDistance to 0 as part of their application. Added WG review label for wider review. |
Update formulas to allow 0. |
Thank you! Feel free to close it. |
Fix #1105: Allow refDistance to be 0 for PannerNode
Reverts the change that required refDistance to be strictly positive. This was updated in the spec in issue WebAudio/web-audio-api#1105, fixed by WebAudio/web-audio-api#1150 BUG=672156 TEST=Panner/panner-distance-clamping.html Review-Url: https://codereview.chromium.org/2807313002 Cr-Commit-Position: refs/heads/master@{#464178}
Hi,
Changes introduced in #1064
contradict with OpenAL specification: https://www.openal.org/documentation/openal-1.1-specification.pdf
Where
AL_REFERENCE_DISTANCE
takes[0, any]
($Table 4-12)I understand that proposed changes prevent to have strange result for exponential mode, but in case of linear mode it's safe to have
0
as a value.I brought OpenGL as a reference, because when a game is ported with Emscripten to ASM.js/WebAssembly, and it uses OpenAL then it will throw an exception.
CC:
@rtoy
@padenot
The text was updated successfully, but these errors were encountered: