Andrew McDonald wrote:
I don't see why everyone's getting so excited about whether or not we
have units. Effectively we *do* - the OpenAL distance unit and the
OpenAL time unit (which is already a second I believe in the spec).
It's just that they aren't explicitly related to any "real" units.
It's actually an assumption we're making that the original 343.3 is in
metres per second - it might just as well be an unhelpful default
speed of sound in feet per hour for some random atmosphere. In fact
it's simply in the same units as the velocity values in the doppler
equation.
Using units or not is not a big issue, but the spec defines the AL as
unit-neutral in section 3.3 of the spec, yet later it requires m/s for
Doppler equation (as it exists in the 1.1 draft). For the sake
preventing the AL of becoming schizophrenic, I feel that one way should
be chosen and used throughout .
Pros of using units:
Allows the AL to model acoustics based on physical limitations.
Cons of using units:
The AL is no longer unit-neutral, all the source/listener velocities
will need to be passed in AL units.
I would be much happier with just specifying the speed of sound as a
global constant, in the same units as my velocity values. That would
be used by all effects that require the speed of sound as a parameter
in their equations. To tweak or disable doppler specifically, use the
per-source doppler factor I suggested. I wouldn't be averse to setting
this on all my sources, you have to do a bit of per-source set up
anyway so it's not much to ask at source creation time. I don't see a
problem with effects/extensions sharing a single speed of sound
constant as long as they have individual controls for artistic
tweaking, which I would expect anyway. All these presets and distance
factors etc seem to make a very complex API, without any *real*
benefit that I can see... just my tuppence anyway :-p
The idea of a speed of sound using the same units as the ones used for
velocity keeps everything working together and keeping the AL
unit-neutral. This also allows existing acoustic models to work in
other mediums.
The idea of having more complex acoustic models in the AL is fine, but
the AL must expose the constants of the models for the user to modify.
That would allow for any tweaking of the model.
--
James Tomaschke
Snr. Software Engineer
InfoSemiconductor, Inc.
|