Fadeout

From Odwiki

Jump to: navigation, search

Credit: Larry Gritz

Given the output of some band-limited function g, its known average g_avg, its feature size featuresize (in the sampling space) at its currently highest frequency, and a filterwidth, this will fade to the given average as we approach the Nyquist limit. Perlin's noise() function, for example, can be antialiased using a similar technique.

#define fadeout(g,g_avg,featuresize,filtwidth) \
        lerp(g, g_avg, smooth(0.2,0.6,fwidth/featuresize))
© 2009 od[force].net | advertise