Skip to content

Instantly share code, notes, and snippets.

@Ruberald
Created September 14, 2023 05:52
Show Gist options
  • Save Ruberald/7993b54c58401fb88022a470b2415f1c to your computer and use it in GitHub Desktop.
Save Ruberald/7993b54c58401fb88022a470b2415f1c to your computer and use it in GitHub Desktop.
cool shader, what does it do?
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
float factor_x;
float factor_y;
vec2 opposing_factor;
void main() {
vec2 st = gl_FragCoord.xy/u_resolution;
vec2 mt = u_mouse/u_resolution;
factor_x = abs(0.3 * cos(1.0 * u_time)/(st.x - 0.5));
factor_y = abs(0.3 * sin(1.5 * u_time)/(st.y - 0.5));
opposing_factor = vec2(step(1.0 - factor_x, 0.2), step(1.0 - factor_y, 0.2));
gl_FragColor = vec4(step(factor_x, 0.5), step(factor_x * factor_y, 0.5), step(factor_y, 0.5),1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment