From d4ca478ad313c6c20834e410ba14ad3a5e7b20bf Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 12 Jun 2012 10:28:26 -0700 Subject: Material cleanup & bug fixes. --- assets/shaders/ZInvert.frag.glsl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'assets/shaders/ZInvert.frag.glsl') diff --git a/assets/shaders/ZInvert.frag.glsl b/assets/shaders/ZInvert.frag.glsl index b1fd1748..1566b881 100644 --- a/assets/shaders/ZInvert.frag.glsl +++ b/assets/shaders/ZInvert.frag.glsl @@ -4,6 +4,7 @@ precision highp float; uniform vec2 u_resolution; uniform float u_time; +uniform float u_speed; uniform sampler2D u_tex0; void main(void) @@ -11,11 +12,13 @@ void main(void) vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy; vec2 uv; + float time = u_time * u_speed; + float a = atan(p.y,p.x); float r = sqrt(dot(p,p)); - uv.x = cos(0.6+u_time) + cos(cos(1.2+u_time)+a)/r; - uv.y = cos(0.3+u_time) + sin(cos(2.0+u_time)+a)/r; + uv.x = cos(0.6+time) + cos(cos(1.2+time)+a)/r; + uv.y = cos(0.3+time) + sin(cos(2.0+time)+a)/r; vec3 col = texture2D(u_tex0,uv*.25).xyz; -- cgit v1.2.3