weird: rothko succeeds now! yay

This commit is contained in:
2017-06-09 23:26:20 -04:00
parent b7ad9aca09
commit 3c7201641e

View File

@@ -6,7 +6,7 @@ uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
float random (in vec2 st) {
float random (in vec2 st) {
return fract(sin(dot(st.xy,
vec2(12.9898,78.233)))
* 43758.5453123);
@@ -27,8 +27,8 @@ float noise (in vec2 st) {
vec2 u = f*f*(3.0-2.0*f);
return mix(a, b, u.x) +
(c - a)* u.y * (1.0 - u.x) +
return mix(a, b, u.x) +
(c - a)* u.y * (1.0 - u.x) +
(d - b) * u.x * u.y;
}
@@ -55,9 +55,15 @@ void main() {
}
st_.x /= 3.;
st_ *= 10.;
for (float i=0.;i<100.;i++) {
color += noise(st_*i)*0.03 * (random(st_*i) > 0.5 ? -1. : 1.);
int max = int(50.*abs(sin(u_time)))+100;
for (int i=0;i<150;i++) {
if (i>max) break;
vec2 target= st_*0.0001+float(i);
color += noise(target)* 0.03 * (random(target) > 0.5 ? -1. : 1.);
}
if (color.x == 0. && color.y == 0. && color.z == 0.) {
color = vec4(0.,0.,0.,1.);
}
gl_FragColor = vec4(color);