- #ifdef GL_ES
- precision mediump float;
- #endif
- uniform sampler2D u_texture;
- uniform vec2 u_resolution;
- uniform vec2 u_mouse;
- uniform float u_diag;
- varying vec4 v_color;
- varying vec2 v_texCoord0;
- void main() {
- float glFCx = float(gl_FragCoord.x);
- float glFCy = float(gl_FragCoord.y);
- float sigma = 50000;
- vec2 dist2 = vec2(pow(abs(glFCx-u_mouse.x),2), pow(abs(glFCy-u_mouse.y),2));
- float distScalar2 = dist2.x+dist2.y;
- float normDistScalar = sqrt(distScalar2)/u_diag;
- float lightness = exp(-distScalar2/sigma);
- vec4 baseColor = texture2D(u_texture, v_texCoord0);
- float leftness = glFCx / u_resolution.x;
- float downness = glFCy / u_resolution.y;
- gl_FragColor = vec4(min(leftness+(1.0-baseColor.w), 1), min(downness+(1.0-baseColor.w), 1), min(1.0+(1.0-baseColor.w), 1), 1.0)*lightness;
- }
SHARE
TWEET
Untitled
a guest
Sep 11th, 2014
191
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
