From 51579b39c853ca7bf2307c8a4c3223be2b91632b Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sat, 19 May 2018 16:02:23 +0200 Subject: [PATCH] Add matrix-but-its-a-circle.glsl --- matrix-but-its-a-circle.glsl | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 matrix-but-its-a-circle.glsl diff --git a/matrix-but-its-a-circle.glsl b/matrix-but-its-a-circle.glsl new file mode 100644 index 0000000..125b123 --- /dev/null +++ b/matrix-but-its-a-circle.glsl @@ -0,0 +1,35 @@ + +#ifdef GL_ES +precision mediump float; +#extension GL_OES_standard_derivatives : enable +#endif + +uniform float time; +uniform vec2 mouse; +uniform vec2 resolution; + +// ---------------------------------------------------------------------------------------------------- + +// variation of https://www.shadertoy.com/view/MscXWM +// in the taste of http://9gag.com/gag/am9peXo + +#define TAU 6.283185307179586 +#define A 26.*fract(time*0.0002)*a + time +#define d O += 0.1*(1.+cos(A)) / length(vec2( fract(a*k*150./TAU)-.5, 16.*(length(U)-.1*k*sin(A)-1.5*k))); a += TAU; +#define c d d d k+=0.65*k; + +void mainImage( out vec4 O, vec2 U, vec2 iResolution ) +{ + U = (U+U-(O.xy=iResolution.xy))/O.x; + float a = atan(U.x,U.y), k=0.125; + O -= O; + c c c c + O *= O; + O.y = length(O); +} + +// ---------------------------------------------------------------------------------------------------- + +void main( void ) { + mainImage( gl_FragColor, gl_FragCoord.xy, resolution ); +}