Guest User

Untitled

a guest
Jan 19th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. uniform sampler2D texture;
  2. uniform vec2 textureSize;
  3.  
  4. varying vec2 uv;
  5.  
  6. void main(){
  7. vec2 puv = uv*textureSize;
  8.  
  9. vec2 hfw = fwidth(puv)/2.0;
  10. vec2 fl = floor(puv - 0.5) + 0.5;
  11.  
  12. vec2 nnn = (fl + smoothstep(0.5 - hfw, 0.5 + hfw, puv - fl))/textureSize;
  13. gl_FragColor = texture2D(texture, nnn);
  14. }
Add Comment
Please, Sign In to add comment