XACT and occlusion
Hi all. Just a quick Q about how to go about setting occlusion parameters in XACT:
I'm unfamiliar with exatly how occlusion data is generated within a
game engine, and I'm trying to anticipate some needs for an upcoming
project.
First off, would it be simple for a game engine to generate a single
occlusion value to feed my variable, or does occlusion consist of
multiple values?
In other words if I set an RPC parameter named "occlusion" with values
from 0-100 where zero = nothing in between the listener and emitter and
100 = a wall completely in between the listener and emitter
[obstruction], would that be enough control? Would more variables
be needed? Is 0-100 fine enough, or should I go with 0-1000?
Secondly, is there any plan to make some sort of occlusion property
native to all sounds (the way that distance is) in the future?
That would be cool. :)
How are you guys dealing with occlusion in general in XACT? I'm
working with an FPS right now that pretty much ignores occlusion, but
could reap some rewards from paying attention to it.
[1101 byte] By [
ReneC] at [2008-2-14]
Hi Renee,
Excellent question! The X3DAudio library (the 3D library that XACT utilizes with its XACT3DCalculate and XACT3DApply calls) actually allows for other elements to drive filtering besides just obstructions and occlusions. For instance, air itself acts as a low-pass filter with distance. So you can create a filter-vs-distance curve, which the library can utilize as it calculates the distance factor, to deliver back a filter coefficient as well. The X3DAudio library doesn't do any DSP itself, it simply returns values that the utilizing library (e.g. XACT) can choose to use or ignore.
Now as to how to do occlusion/obstruction filtering, XACT itself currently supports a reverberation DSP effect but not any EQ or filtering effects. If you're doing a title on Xbox 360, the output from XACT can be routed to an XAudio (the lower-level audio library) voice, where you could apply this kind of arbitrary filtering. If your title is Windows only, there's no real filtering support solution at this point.
As a really cheap alternative to actual filtering, you could simply have occlusion/obstruction filtering apply as attenuation to a playing sound. It could actually also drive the wet/dry mix, which would help exaggerate that you're hearing the indirect (reverb) path and not the direct (dry) path as an obstacle comes between the emitter and the listener. So yes, you could create an variable named obstruction and have it map to volume. You might also do a second curve for obstruction_material or something like that, so if the obstacle is a piece of cloth it doesn't block out the sound as effectively as a heavy curtain or sheet of metal.
I'd actually do a separate variable for occlusion, since occlusion is different behaviorally from obstruction (generally simulated by filtering the indirect path as well as the direct path). For occlusion, you might similarly bring down the reverb as the occlusion factor gets higher. Again, you could be extra fancy and have a separate variable specifying the material (e.g. how dense the wall material is - so the sound is only slightly muffled for two rooms separated by a curtain, but the 10-foot iron wall virtually silences sounds from the room next door.)
Hope this helps!
-Scott
This is really interesting.
I assume if you are in a situation like you are in a pathway coming from an elevator infront of you is a thick wall but left and right there are paths of inequal length that lead behind the thick wall from the sides and behind the thick wall theres eg an explosion one could calculate the path of the soundwaves bouncing off the walls reaching the player and then it becomes even more realistic. I wonder how to do that, I assume placing the 3d sounds with the entire added vector of the length of entire path, with some param for what the walls do to the soundwave and make to the unit vector of the vector along the nearest falloffpoint have the entire path's length on the wall of each side the sound could come from from above example. I wonder how to keep track of such a thing. Would one just try to make such a 3d sound for each path available I assume?
Would be cool if that was in the api:) like what lighting and radiosity etc are for rendering to have something like that for more realistic Sound.
Nils