VEX noise() function
The noise() function is Houdini's implementation of Perlin noise. Perlin noise is generated
from an underlying n -dimensional lattice, n being typically from one to four.
Random gradient vectors are assigned to the lattice points. The noise value at a point is the
result of interpolation using the dot product of the distance vectors from the point to the nearest
lattice points, and the gradient vectors at those points. As a result of its construction, Perlin
noise is a scalar function of position in the n -dimensional space.
scalar noise, scalar parameter
float y = noise( float x );
scalar noise, 2D parameter
float y = noise( float x, float z );
scalar noise, vector3 parameter
Perlin noise can also be generated from an underlying three dimensional grid.
That is what happens if the noise() function is called with a vector3 argument.
In the following example, I've used displayed noise as a function of the first
two components, with time as the third component.
float t = 0.1 * @Frame;
vector v = set(@x,@z,t);
float @y = noise(v);
vector noise (noise function returning vector)
As mentioned previously, Perlin noise is a scalar noise. Although it may be generated by
a grid of any dimension, the noise value created is necessarily scalar. Curiously,
Houdini allows for a vector return type for each of the above forms of noise().
vector v = noise( ... );
But once you inspect the vector returned, you see it's just the same number copied to
each of the three components.
vector v = noise( ... );
// equivalent to
float y = noise( ... );
vector v = set(y,y,y);
So it's important to note that Houdini's vector Perlin noise is not really random!. All the
vectors generated have random magnitudes, but exactly the same direction.