From 96a0a8c916533eb5625816192ed38488f639326d Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 22 Feb 2012 11:00:20 -0800 Subject: Integrating canvas-2d drawing and WebGL fixes, including adding back WebGL materials. Signed-off-by: Nivesh Rajbhandari --- assets/shaders/SquareTunnel.frag.glsl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 assets/shaders/SquareTunnel.frag.glsl (limited to 'assets/shaders/SquareTunnel.frag.glsl') diff --git a/assets/shaders/SquareTunnel.frag.glsl b/assets/shaders/SquareTunnel.frag.glsl new file mode 100644 index 00000000..51ef7b7c --- /dev/null +++ b/assets/shaders/SquareTunnel.frag.glsl @@ -0,0 +1,21 @@ +#ifdef GL_ES +precision highp float; +#endif + +uniform vec2 u_resolution; +uniform float u_time; +uniform sampler2D u_tex0; + +void main(void) +{ + vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy; + vec2 uv; + + float r = pow( pow(p.x*p.x,16.0) + pow(p.y*p.y,16.0), 1.0/32.0 ); + uv.x = .5*u_time + 0.5/r; + uv.y = 1.0*atan(p.y,p.x)/3.1416; + + vec3 col = texture2D(u_tex0,uv).xyz; + + gl_FragColor = vec4(col*r*r*r,1.0); +} -- cgit v1.2.3