Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uniform sampler2D tex0;
- varying vec2 tcoord;
- uniform sampler2D offset;
- uniform float intensity;
- void main() {
- // Sample the input pixel
- vec2 uv = tcoord;
- uv.y = 1-uv.y;
- vec4 c = texture2D(offset,uv);
- uv.x += (c.r-0.5)*intensity;
- uv.y += (c.g-0.5)*intensity;
- uv.x = clamp(uv.x,0,1);
- uv.y = clamp(uv.y,0,1);
- // Save the result
- gl_FragColor = texture2D(tex0,uv);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement