From db2bb0ab5d2747f0d07878e3b8a7d2d10c755110 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 7 Jun 2012 17:07:21 -0700 Subject: Material cleanup --- assets/shaders/Deform.frag.glsl | 3 ++- assets/shaders/Fly.frag.glsl | 5 +++-- assets/shaders/Julia.frag.glsl | 3 ++- assets/shaders/Keleidoscope.frag.glsl | 8 ++++++-- 4 files changed, 13 insertions(+), 6 deletions(-) (limited to 'assets') diff --git a/assets/shaders/Deform.frag.glsl b/assets/shaders/Deform.frag.glsl index 1dbe45a0..a2bb4fa0 100644 --- a/assets/shaders/Deform.frag.glsl +++ b/assets/shaders/Deform.frag.glsl @@ -3,6 +3,7 @@ precision highp float; #endif uniform float u_time; +uniform float u_speed; uniform vec2 u_resolution; //uniform vec4 mouse; uniform sampler2D u_tex0; @@ -19,7 +20,7 @@ void main(void) float r2 = sqrt(dot(p+m,p+m)); vec2 uv; - uv.x = 0.2*u_time + (r1-r2)*0.25; + uv.x = 0.2*u_time*u_speed + (r1-r2)*0.25; uv.y = sin(2.0*(a1-a2)); float w = r1*r2*0.8; diff --git a/assets/shaders/Fly.frag.glsl b/assets/shaders/Fly.frag.glsl index f99b5ab8..d36928a1 100644 --- a/assets/shaders/Fly.frag.glsl +++ b/assets/shaders/Fly.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,13 +12,13 @@ void main(void) vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy; vec2 uv; - float an = u_time*.25; + float an = u_time*u_speed*.25; float x = p.x*cos(an)-p.y*sin(an); float y = p.x*sin(an)+p.y*cos(an); uv.x = .25*x/abs(y); - uv.y = .20*u_time + .25/abs(y); + uv.y = .20*u_time*u_speed + .25/abs(y); gl_FragColor = vec4(texture2D(u_tex0,uv).xyz * y*y, 1.0); } diff --git a/assets/shaders/Julia.frag.glsl b/assets/shaders/Julia.frag.glsl index 68cda703..7e616c40 100644 --- a/assets/shaders/Julia.frag.glsl +++ b/assets/shaders/Julia.frag.glsl @@ -4,11 +4,12 @@ precision highp float; uniform vec2 u_resolution; uniform float u_time; +uniform float u_speed; void main(void) { vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy; - vec2 cc = vec2( cos(.25*u_time), sin(.25*u_time*1.423) ); + vec2 cc = vec2( cos(.25*u_time*u_speed), sin(.25*u_time*u_speed*1.423) ); float dmin = 1000.0; vec2 z = p*vec2(1.33,1.0); diff --git a/assets/shaders/Keleidoscope.frag.glsl b/assets/shaders/Keleidoscope.frag.glsl index 7d1bdb17..7d95a95b 100644 --- a/assets/shaders/Keleidoscope.frag.glsl +++ b/assets/shaders/Keleidoscope.frag.glsl @@ -4,20 +4,24 @@ precision highp float; uniform vec2 u_resolution; uniform float u_time; +uniform float u_speed; uniform sampler2D u_tex0; 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 = 7.0*a/3.1416; - uv.y = -u_time+ sin(7.0*r+u_time) + .7*cos(u_time+7.0*a); + uv.y = -time + sin(7.0*r+time) + .7*cos( + +7.0*a); - float w = .5+.5*(sin(u_time+7.0*r)+ .7*cos(u_time+7.0*a)); + float w = .5+.5*(sin(time+7.0*r)+ .7*cos(time+7.0*a)); vec3 col = texture2D(u_tex0,uv*.5).xyz; -- cgit v1.2.3