Audiokinetic Wwise Knowledge Base

Can I use non-spherical sound attenuation with Wwise? (or how to make your grandstands, waterfalls, rivers, etc sound “big”)

Attenuation for 3D sounds in Wwise is spherical – that is, attenuation curves (for Dry Volume, Wet Volume, LFE, Low pass filter and Spread) are based on distance between the game object’s position and the listener position. This works well for “small” emitters, but when you have game objects such as grandstands, waterfalls, rivers, etc., sound should not come from a single point in space but rather from the “whole” game object.

While Wwise doesn’t directly support game objects that are not just a point in space with an attenuation sphere, a little extra code in the game can achieve proper results.

For example, let’s say you want a waterfall to emit sound as if it was a wide and tall rectangular box. If the listener is inside or exactly on the surface of that box, you want no attenuation at all, and if it is outside of the box, you want attenuation to be based on the distance between the listener and the box. Here is how you can do that in your game using the Wwise sound engine:

  • The game itself holds the data about the 3D “box” that represents the waterfall
  • Instead of positioning the Wwise game object for the waterfall at a fixed 3D position (probably at the center of the waterfall), its position is computed: It is the point closest to the listener, inside the box. More clearly: If the listener position is within the volume, then the game object’s position is the same as the listener’s position. If however the listener is outside of the volume, then you find the point on the surface of the volume that is closest to the listener, and that becomes the game object’s position. Note: instead of computing this on your side, you may pass a set of positions to the game object, spread across the surface in "multi-directions" mode. Wwise will use the position that is closest to the listener. Refer to this article, and the SDK documentation of multi-positioning for more details.
  • The rest is done using regular Wwise spherical attenuation (it will have an effect only when the listener and the game object are not at the same position, i.e. when the listener is outside of the box). You should use Volume attenuation so the sound gets fainter as you get further away from the game object. You should also use the Spread curve to make the sound "bigger" when you are close to or inside the volume, and "smaller" (point source) when you are far. See http://kb.gowwise.com/questions/51 for more information on Spread.

You can apply the same mechanism for any other shape such as pyramids, tori, or even 2D surfaces.

This involves a bit of programming on your side, but it should be fairly easy to implement and the results should be very convincing.




Article Details

Last Updated
25th o February, 2010

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (2 votes)

100% thumbs up 0% thumbs down

How would you rate this answer?



Thank you for rating this answer.

Related Articles

Attachments

No attachments were found.

Continue