const mat2 mtx = mat2( 0.80, 0.60, -0.60, 0.80 );
float fbm6( vec2 p ) {
float f = 0.0;
f += 0.500000*perlinNoise( p ); p = mtx*p*2.02;
f += 0.250000*perlinNoise( p ); p = mtx*p*2.03;
f += 0.125000*perlinNoise( p ); p = mtx*p*2.01;
f += 0.062500*perlinNoise( p ); p = mtx*p*2.04;
f += 0.031250*perlinNoise( p ); p = mtx*p*2.01;
f += 0.015625*perlinNoise( p );
return f/0.96875;
}
Value Noise
float valueNoise(vec2 p) {
vec2 w = floor(p);
vec2 k = fract(p);
k = k*k*(3.-2.*k); // smooth it
float n = w.x*10. + w.y*48.;
float a = hash(n);
float b = hash(n+10.);
float c = hash(n+48.);
float d = hash(n+58.);
return mix(
mix(a, b, k.x),
mix(c, d, k.x),
k.y);
}