Simulation noise

Simulation noise is a function that creates a divergence-free vector field. This signal can be used in artistic simulations for the purposes of increasing the perception of extra detail.

The function can be calculated in three dimensions by dividing the space into a regular lattice grid. With each edge is associated a random value, indicating a rotational component of material revolving around the edge. By following rotating material into and out of faces, one can quickly sum the flux passing through each face of the lattice. Flux values at lattice faces are then interpolated to create a field value for all positions.

Perlin noise is the earliest form of lattice noise, which has become very popular in computer graphics. Perlin Noise is not suited for simulation because it is not divergence-free.

Noises based on lattices, such as simulation noise and Perlin noise, are often calculated at different frequencies and summed together to form band-limited fractal signals.

Other approaches developed later that use vector calculus identities to produce divergence free fields, such as "Curl-Noise" as suggested by Robert Bridson, and "Divergence-Free Noise" due to Ivan DeWolf. These often require calculation of lattice noise gradients, which sometimes are not readily available. A naive implementation would call a lattice noise function several times to calculate its gradient, resulting in more computation than is strictly necessary. Unlike these noises, simulation noise has a geometric rationale in addition to its mathematical properties. It simulates vortices scattered in space, to produce its pleasing aesthetic.

Curl Noise
The vector field is created as follows, for evey point (x,y,z) in the space a vector field G is created, every component x, y and z of the vector field (Gx, Gy, Gz) is defined by a 3D perlin or simplex noise function with x, y and z as parameters. The partial derivative of Gx, Gy, and Gz respect to x, y and z is obtained with the gradient of the perlin or simplex noise by finite diferences of implicit calculation inside the simplex noise.

The partial derivatives are used to calculate F as the curl of G given by

$$F = (\frac{\partial Gz}{\partial y} - \frac{\partial Gy}{\partial z} ,\frac{\partial Gx}{\partial z} - \frac{\partial Gz}{\partial x},\frac{\partial Gy}{\partial x} - \frac{\partial Gx}{\partial y})$$

Bitangent Noise
This method is based in the fact that the curl of the gradient of scalar field is zero and the identity that expand the divergence of a cross product of two vectors A and B as the difference of the dot products of each vector with the curl of the other:

$$\nabla \times ( \nabla \varphi ) = \mathbf{0}.$$

$$\nabla \cdot (\mathbf{A} \times \mathbf{B}) =\ (\nabla {\times} \mathbf{A}) \cdot \mathbf{B} \,-\, \mathbf{A} \cdot (\nabla {\times} \mathbf{B})$$

which means that if the curl of both vector fields is zero then the divergence of the product of two vectors that are the gradients of scalar fields is zero too. This result in a divergence free vector field by construction only calling two noise functions to create the scalar fields.

The vector field es created as follows, two scalar fields are calculated $$\phi$$ and $$\psi$$ using 3D perlin or simplex noise functions, then the gradients A and B of each of this fields is calculated, the cross product of A and B gives a divergence free vector field.

Signed Distance Noise
The vector field is created based on the implicit equation of a closed and differentiable surface. For every point in the space, frecuently outside or near the surface, a normal n to the surface is calculated, this is calculated the same way as the distance signed funcion, using the partial derivatives divided by the distance to the surface. Outside of the surface all these normals point away from the surface. After that a scalar value p is calculated for that point in the space using a 3D perlin or simplex noise function. Now we create a vector field F = pn pointing outside of the surface. Then the curl of this vector field gives the direction in every point in the space where the particles should move. By construction oh this vectors F will point in a tangen direction to a isosurface given by the same signed distance to the original surface and can be used to confine the movements of each particle to stay in that surface