Gyroid noise from shadertoy.com/view/ddx3wb
Log in to post a comment.
#version 300 es
precision highp float;
uniform float iTime;
in vec2 vScreen;
out vec4 fragColor;
float gyroid (vec3 seed) {
return dot(sin(seed),cos(seed.yzx));
}
float fbm (vec3 seed) {
float result = 0., a = .5;
for (int i = 0; i < 6; ++i) {
// extra spicy twist
seed.z += result*.5;
// bounce it with abs
result += abs(gyroid(seed/a))*a;
a /= 2.;
}
return result;
}
float noise (vec2 p) {
// improvise 3d seed from 2d coordinates
vec3 seed = vec3(p, length(p) - iTime * .025);
// make it slide along the sin wave
return sin(fbm(seed)*7.)*.5+.5;
}
void main() {
fragColor.xyz = vec3(noise(vScreen));
}