Tried making a new kind of noise.
this is the length being presented
Here is code
#glsl #graphics #perlinnoise
Tried making a new kind of noise.
this is the length being presented
Here is code
#glsl #graphics #perlinnoise
Code:
vec2 p; //pos
ivec2 i = ivec2(floor(p));
// random no. [-1,1] + [-1,1]i
vec2 g0 = grad(i);
vec2 g1 = grad(i + ivec2(1, 0));
vec2 g2 = grad(i + ivec2(0, 1));
vec2 g3 = grad(i + ivec2(1, 1));
vec2 f = fract(p);
// complex mult
vec2 v0 = compMul(g0, f);
vec2 v1 = compMul(g1, f - vec2(1, 0));
vec2 v2 = compMul(g2, f - vec2(0, 1));
vec2 v3 = compMul(g3, f - vec2(1, 1));
// quintic fade
vec2 a = vec2(fade(f.x), fade(f.y));
return bmix(v0, v1, v2, v3, a.x, a.y);
}
vec2 fbmComp2(vec2 p) {
mat2 f = mat2(
cos(TAU / 16), sin(TAU / 16),
-sin(TAU / 16), cos(TAU / 16)
);
vec2 f0 = noise2(p);
vec2 f1 = noise2(p * f);
vec2 f2 = noise2(p * f * f);
vec2 f3 = noise2(p * f * f * f);
return bmix(f0, f1, f2, f3, 0.5, 0.5);
}