1 uniform sampler2D sceneTex;
2 uniform float textureWidth;
3 uniform float textureHeight;
11 // Converts pixel coordinates to texture coordinates
12 vec2 pix2tex(vec2 pix)
14 return vec2(pix.x / textureWidth, 1.0 - pix.y / textureHeight);
19 vec2 texcoord = gl_TexCoord[0].xy;
21 float dx = cursorX - texcoord.x;
22 float dy = cursorY - texcoord.y;
23 float dist = sqrt(dx*dx + dy*dy);
26 float disp = sin(dist / radius * PI) * (zoom - 1.0) * 20.0;
27 texcoord.x += dx / dist * disp;
28 texcoord.y += dy / dist * disp;
31 gl_FragColor = texture2D(sceneTex, pix2tex(texcoord));