From ab2204c233c97079dc5fcc14216d4606b1f7253f Mon Sep 17 00:00:00 2001 From: Patricio Gonzalez Vivo Date: Sun, 27 Sep 2015 23:16:32 +0000 Subject: [PATCH] editing on RPI --- 11/tmp/vortex.frag | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/11/tmp/vortex.frag b/11/tmp/vortex.frag index cfc6823..e2f2550 100644 --- a/11/tmp/vortex.frag +++ b/11/tmp/vortex.frag @@ -73,6 +73,11 @@ float cascade(vec2 st, vec2 zoom, float time, float warp) { void main() { vec2 st = gl_FragCoord.xy/u_resolution.xy; + if (u_resolution.x>u_resolution.y) { + st.x *= u_resolution.x/u_resolution.y; + } else { + st.y *= u_resolution.y/u_resolution.x; + } vec3 color = vec3(0.0); vec2 pos = st-vec2(.5); float r = dot(pos,pos); @@ -86,4 +91,4 @@ void main() { color *= 1.0-smoothstep(.11,.13,r); gl_FragColor = vec4(color,1.0); -} \ No newline at end of file +}