Advertisement
Guest User

Pastel Soften

a guest
May 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifdef GL_FRAGMENT_PRECISION_HIGH
  2. precision highp float;
  3. #else
  4. precision mediump float;
  5. #endif
  6.  
  7. uniform vec2 resolution;
  8. uniform vec2 cameraAddent;
  9. uniform mat2 cameraOrientation;
  10. uniform samplerExternalOES cameraBack;
  11. uniform sampler2D backbuffer;
  12. uniform int pointerCount;
  13. uniform vec2 touch;
  14.  
  15. vec3 at_cam(vec2 offset)
  16. {
  17.     vec2 uv = (gl_FragCoord.xy + offset) / resolution.xy;
  18.     vec2 st = cameraAddent + uv * cameraOrientation;
  19.     return texture2D(cameraBack, st).rgb;
  20. }
  21.  
  22. vec3 at_back(vec2 offset)
  23. {
  24.     vec2 uv = (gl_FragCoord.xy + offset) / resolution.xy;
  25.     return texture2D(backbuffer, uv).rgb;
  26. }
  27.  
  28. int r_int(float f) {
  29.     return int(f+0.5);
  30. }
  31.  
  32. void main(void) {
  33.  
  34.   const int layers = 4;
  35.   const int range = 2;
  36.  
  37.   const int lyp1 = layers+1;
  38.   const float ly1 = float(lyp1);
  39.   const float ly2 = ly1*ly1;
  40.   const float ly3 = ly2*ly1;
  41.     const int hlist_size = int(pow(3.0, ly1+1.0)/2.0);
  42.     vec2 tuv = touch.xy / resolution.xy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement