SHARE
TWEET

Untitled

a guest Sep 4th, 2014 6 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uniform sampler2D prevFrame;
  2. uniform sampler2D currentFrame;
  3. const float weight = 0.05;
  4.  
  5. varying vec2 v_texCoords0;
  6. void main()
  7. {
  8.  
  9.     gl_FragColor = weight *
  10.  
  11.             (
  12.                 texture2D(currentFrame, v_texCoords0) +
  13.                 texture2D(currentFrame, v_texCoords0 + vec2(0, 0.004)) +
  14.                 texture2D(currentFrame, v_texCoords0 - vec2(0, 0.004)) +
  15.                 texture2D(currentFrame, v_texCoords0 + vec2(0.004, 0)) +
  16.                 texture2D(currentFrame, v_texCoords0 - vec2(0.004, 0)))
  17.  
  18.                / 5 +
  19.  
  20.             ( 1 - weight) *
  21.  
  22.            (
  23.                 texture2D(prevFrame, v_texCoords0) +
  24.                 texture2D(prevFrame, v_texCoords0 + vec2(0, 0.008)) +
  25.                 texture2D(prevFrame, v_texCoords0 - vec2(0, 0.008)) +
  26.                 texture2D(prevFrame, v_texCoords0 + vec2(0.008, 0)) +
  27.                 texture2D(prevFrame, v_texCoords0 - vec2(0.008, 0)))
  28.  
  29.             / 5;
  30.  
  31.     gl_FragColor *= step(0.005, gl_FragColor);
  32. }
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. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top