weird: added another ikeda sketch
This commit is contained in:
34
weird/ikeda2.glsl
Normal file
34
weird/ikeda2.glsl
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
// this took way too long
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform float u_time;
|
||||||
|
uniform vec2 u_mouse;
|
||||||
|
|
||||||
|
float random(in float x) {
|
||||||
|
return fract(sin(x)*1e6);
|
||||||
|
}
|
||||||
|
|
||||||
|
float col(vec2 st, vec2 v) {
|
||||||
|
float mouse = .3+clamp((u_mouse.x/u_resolution.x), 0., .6);
|
||||||
|
vec2 pos = st+v;
|
||||||
|
return step(mouse, random(70.+pos.x*0.00001));
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec2 st = gl_FragCoord.xy/u_resolution.xy;
|
||||||
|
st.x *= u_resolution.x/u_resolution.y;
|
||||||
|
|
||||||
|
st *= vec2(10.,50.);
|
||||||
|
|
||||||
|
vec2 s = vec2(u_time*30.)*(vec2(-1.,0.)*random(floor(st.y)+1.));
|
||||||
|
|
||||||
|
vec2 o = vec2(0.02,0.);
|
||||||
|
|
||||||
|
vec3 color = vec3(col(st-o, s), col(st, s), col(st+o, s));
|
||||||
|
color *= step(0.2, fract(st).y);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(1.-color,1.);
|
||||||
|
}
|
Reference in New Issue
Block a user