[Bf-committers] new flow noise turbulence feature

Lukas Tönne lukas.toenne at googlemail.com
Sat Feb 13 09:55:12 CET 2010


Hi,

I present here a new noise function called "flow noise". This is an
extension to the usual Perlin noise method, which allows for
pseudo-physical animation of turbulence by rotating the noise base
vectors. From the original author of this code, Stefan Gustavson:

 * This is an implementation of Perlin "simplex noise" over two dimensions
 * (x,y) and three dimensions (x,y,z). One extra parameter 't' rotates the
 * underlying gradients of the grid, which gives a swirling, flow-like
 * motion. The derivative is returned, to make it possible to do pseudo-
 * advection and implement "flow noise", as presented by Ken Perlin and
 * Fabrice Neyret at Siggraph 2001.
 *
 * When not animated and presented in one octave only, this noise
 * looks exactly the same as the plain version of simplex noise.
 * It's nothing magical by itself, although the extra animation
 * parameter 't' is useful. Fun stuff starts to happen when you
 * do fractal sums of several octaves, with different rotation speeds
 * and an advection of smaller scales by larger scales (or even the
 * other way around it you feel adventurous).
 *
 * The gradient rotations that can be performed by this noise function
 * and the true analytic derivatives are required to do flow noise.
 * You can't do it properly with regular Perlin noise.

I made a small test video some time ago to demonstrate the effect:
http://vimeo.com/8929215

While probably not being very useful for textures, it can be a great
method of "faking" physical turbulence effects for fluids, particles,
etc. For this reason i replaced the BLI_gTurbulence function in the
turbulence effector with the new BLI_flowTurbulence function. Note
that this function takes two additional parameters: angle and
advection.

Angle (as described above) is the main animation parameter, which can
be animated to produce whirling motion. If left at a constant, the
resulting (basic) noise is the same as Perlin noise, thus the old
behaviour of the effector can easily be reproduced (even though the
actual function uses simplex noise, see below).

Advection causes an additional shift (or force field strength in terms
of the effector) in the direction of the derivative with respect to
angle. This causes a quite interesting "clumping" effect (or the
opposite for negative factors).

In the DSOnoises package this code was adapted from, there are a
couple of other noise methods, which could be easily merged into
Blender, although they are probably not that interesting:
- simplex noise has the same effect as Perlin noise, but is more
efficient, especially for 3 and 4 dimensions (and above ...)
- 4D noise is another way of generating animatable noise by using the
4th dimension as a variable parameter.
- 2D versions are also available

I prepared a small demo file to show the new effects:
http://www.pasteall.org/blend/1828
There are three cubes with particles: the leftmost is a static
turbulence field as it worked before (but using the new function), the
middle one has additional rotation, and the right one some advection
on top of that. If performance drops too low in realtime playback
(each cube has 5000 particles), you can either enable layers 2,3,4
respectively or bake the particles. One minor issue i had was that
apparently extrapolation modes for f-curves are not yet implemented
(confirm?), so that animating a continuously changing flow rotation is
a bit nasty.
Hope you like this and it can be included into svn.

Regards
phonybone
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flow_noise.diff
Type: text/x-diff
Size: 16557 bytes
Desc: not available
Url : http://lists.blender.org/pipermail/bf-committers/attachments/20100213/09deda4b/attachment-0001.diff 


More information about the Bf-committers mailing list