Wrangle-Pattern

Noise

vector freq = {1,1,1};
vector offset = {0,0,0};
float amp = 1;
int turb = 5;
float rough = 0.5;
float atten = 1;
onoise(@P*freq - offset, turb, rough, atten) * amp
snoise(@P*freq - offset, turb, rough, atten) * amp
anoise(@P*freq - offset, turb, rough, atten) * amp

Perlin noise

float noise = noise(@P);


Original perlin noise

float noise = fit(onoise(@P,5,0.5,1),-0.5,0.5,0,1);

Sparse Convolution noise

float noise = fit(snoise(@P,5,0.5,1),-0.7,0.7,0,1);

Alligator Noise

float noise = anoise(@P,5,0.5,1);

AAnoise 4D

$noise = vop_fbmNoiseFP($pos * $freq - $offset, $rough, $maxoctave, $noisetype); 1D
$noise = vop_fbmNoiseVP($pos * $freq - $offset, $rough, $maxoctave, $noisetype); 3D


#include <voptype.h>
#include <voplib.h>
float noise = vop_fbmNoiseFP(set(@P.x,@P.y,@P.z,@Frame), 1, 5, "noise");

Worley (cellular) noise.

int seed; float f1, f2, f3, f4;
wnoise(@P,seed,f1, f2, f3, f4);

f1

f2

f3

f4

rand(seed)

Worley (cellular) noise using a Chebyshev distance metric

int seed; float f1, f2, f3, f4;
cwnoise(@P,seed,f1, f2, f3, f4);

f1

f2

f3

f4

rand(seed)

Worley (cellular) noise using a Chebyshev distance metric

int seed; float f1, f2, f3, f4;
mwnoise(@P,seed,f1, f2, f3, f4);

f1

f2

f3

f4

rand(seed)

Voronoi Noise

int seed; float f1, f2; vector v1, v2;
vnoise(@P,1,seed,f1, f2, v1, v2);

f1

f2

v1

v2

rand(seed)

Curl Noise

vector noise =curlnoise(@P);
@v = noise;

Curl Noise 4D

#include <voplib.h>
string type = "pnoise";//pnoise, onoise, snoise, anoise, xnoise, exact_pnoise, exact_xnoise;
vector4 P = set(@P.x,@P.y,@P.z,@Frame);
vector4 freq = set(1,1,1,1);
vector4 offset = set(1,1,1,1);
float amp = 1;
float rough = 0.5;
float atten = 1;
int turb = 3;
float h = 0.0001;
float radius = 1;
float dist = 1;
vector normal = set(0,0,0);
string sdf = "";
int bounce = 0;
vector noise =vop_curlNoiseVP(P, freq, offset, normal, type, sdf, turb, bounce, amp, rough, atten, dist, radius, h);


Hexagon

float Pi = 3.141592653;
matrix3 mat = ident();
matrix3 rot[] = array(mat,mat,mat);
rotate(rot[1],Pi * 60 /180, set(0,1,0) );
rotate(rot[2], Pi * 120 /180, set(0,1,0) );
v@hex_vec; v@hex_center; v@hex_uv; i@hex_section_id;
for( int i=0; i<3; i++ ){
    vector recoodiP = @P * rot[i];    
    for( int j=0; j<2; j++ ){
        float column = recoodiP.x /(1.5*2) + 0.5 + j*0.5;
        int column_id = floor(column);
        float column_uv = fit01(column - column_id,-1.5,1.5);
        float temp_centerX = (column_id-j*0.5) * (1.5*2);
        
        float row  =  recoodiP.z / (0.5 * sqrt(3)) + j;
        int row_id = floor(row);
        float row_uv = row - row_id;
        if(row_id%2==0)row_uv = 1-row_uv;
        float temp_centerZ = (floor(float((row_id+1)*0.5))*2 - j )* (0.5 * sqrt(3));
                
        if(abs(column_uv)<row_uv*0.5+0.5){
            @hex_vec[i] = column_id * 2 - j;
            if(i==0){
                @hex_center = set( temp_centerX ,0, temp_centerZ );
            }
            if(abs(column_uv)<row_uv*-0.5+0.5){
                @hex_uv = set(row_uv,column_uv,0);
                @hex_section_id = (row_id%2!=0)?i:i+3;
            }
        }
    }
}

https://www.redblobgames.com/grids/hexagons/