Skip to content

Instantly share code, notes, and snippets.

@oatmealine
Created January 28, 2020 12:38
Show Gist options
  • Save oatmealine/87f294894d5e78c493ea87744522e04d to your computer and use it in GitHub Desktop.
Save oatmealine/87f294894d5e78c493ea87744522e04d to your computer and use it in GitHub Desktop.
lines shader
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
uniform float time;
uniform vec2 resolution;
float round(float num) {
if (num >= 0.5) return ceil(num);
return floor(num);
}
void main(void) {
vec2 uv = vec2(( gl_FragCoord - 0.5*resolution.x ) / resolution.y);
vec3 col = 0.5 + 0.5*cos(time+uv.xyx+vec3(0,2,4));
uv.y += sin(uv.x*3.0)/((uv.x+4.0+sin(time))/0.1);
uv.x += round(uv.y*49.3) * (5.347*round(uv.y*49.3+time+uv.x*(sin(time/10.0)*10.0)*sin(uv.x*3.14)));
gl_FragColor = vec4(col,1.0)*mod(uv.x-time/5.0,0.4);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment