Houdini 11 VEX VEX functions

Voronoi noise gives almost identical results to the Worley noise functions.

  1. void vnoise(float , float , int &, float &, float &, float &, float &)

  2. void vnoise(vector , vector , int &, float &, float &, vector &, vector &)

  3. void vnoise(vector4 , vector4 , int &, float &, float &, vector4 &, vector4 &)

  4. void vnoise(float , float , int &, float &, float &, float &, float &, int )

  5. void vnoise(vector , vector , int &, float &, float &, vector &, vector &, vector )

  6. void vnoise(vector4 , vector4 , int &, float &, float &, vector4 &, vector4 &, vector4 )

  7. void vnoise(vector , vector , int &, float &, float &, vector &, vector &, int , int , int )

  8. void vnoise(float , float , float , float , int &, float &, float &, float &, float &, float &, float &)

  9. void vnoise(vector4 , vector4 , int &, float &, float &, vector4 &, vector4 &, int , int , int , int )

  10. void vnoise(float , float , float , float , int &, float &, float &, float &, float &, float &, float &, int , int )

Voronoi noise gives almost identical results to the Worley noise functions. However, the Voronoi noise functions have controls over jittering (i.e. how randomly the points are scattered through space) and also return the actual locations of the two nearest points. The Voronoi noise functions are limited to returning the two nearest points.

The general form of the wnoise functions is:

void vnoise(position, jitter; int &seed; float &f1, &f2; &pos1, &pos2)
where position, jitter, pos1 and pos2 are a single float (1D noise), two floats (2D noise), a vector (3D noise) or a vector4 (4D noise). The seed is returned in the integer parameter, and the distance to pos1 and pos2 are returned in f1 and f2.

Though this function is slightly more expensive than wnoise, the fact that the actual point positions are returned allows the function to overcome some of the artifacts of Worley noise. For example, to get even boundaries along the cell boundaries:

if (f2 - f1 < tolerance * (distance(p1, p2) / (f1 + f2)) ...
...which will “normalize” the boundary width based on the distance between the two random points in space.

There are also periodic forms of vnoise()

For example:

// 1D noise
float    fp0, fp1, p1x, p1y, p2x, p2y;
vector    vp0, vp1;
vnoise(s*10, 0.8, seed, f1, f2, fp0, fp1);
vnoise(s*10, t*10, 0.8, 0.8, seed, f1, f2, p1x, p1y, p2x, p2y);
vnoise(P*10, {.8, .8, .8}, seed, f1, f2, vp0, vp1);
See noise and randomness in the VEX language guide for more information.

Contexts: all