Game Development Community

Audio Shaders

by Alex Huck · in Game Design and Creative Issues · 12/04/2006 (10:01 am) · 3 replies

Here I am again... with the insanely difficult to program ideas that I have absolutely not enough skill to complete, but I(at least) still think are incredible ideas (to dream about implementing at any rate):

Audio 'shaders'

My definition of shaders is this:
Mathematical calculations performed on the final render of a scene based of characteristics of the world, constants provided by the game are inputed into functions which modify that, for example to convert a rendered scene into a negative image, you input the scenes colors, and multiply each color coordinate (RGBA) by -1

Audio 'Shaders' though not technically shaders by the visual definition above, have similar concept, modified sound based of calculations. Water and fire are hard to render without visual shaders. Audio effects such as the doppler effect* are also nearly impossible to acheive without some mathematical formulas done to the sound to change its pitch based off the sound objects velocity, and distance

I wonder how computationally heavy this would become, visual shaders require special hardware just to run...
The doppler effect alone would be worth it for such an idea, that wouldn't be too computationally heavy I wouldn't think, and quite easy to implement, you have getVelocity commands, and you have change pitch commands (I think they are still in Torque, they were in Tribes 2), put them together in the right formula, and make pirch proportional to something to do with velocity and distance and direction, and voila doppler effect (Maybe a real crappy sounding one)

*The doppler effect is the one where a siren(for example) sounds more high pitched as it approaches, and more low pitch as it moves away.

-edit-Spelling

#2
12/04/2006 (10:16 am)
Ah so that's what EAX is, I've heard of it alot but never looked it up
#3
12/04/2006 (10:40 am)
This is a common concept in the world of audio production. "Filters" is a slightly more common term for it. In most audio production environments you can build chains of filters that transform audio. Take a look at Reason, or Logic for example. In Reason I can make an instrument, route the sound through a reverb filter, then route the output of that through a vocoder, and so forth...

In MacOS X, Core Audio provides a system to allow any application to have these capabilities without having to recreate the substantial infrastructure involved.

The problem you have with this is that filters can get quite computationally expensive and can introduce nasty latency into the audio pipeline. It grates the ears if your sound shows up just a few (12-16) milliseconds too late.

-JF