Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. varying highp vec2 texCoord;
  2.  
  3. const highp vec4 een = vec4(1.0, 1.0, 1.0, 1.0);
  4. const highp vec2 offset1 = vec2(-0.2, -0.2);
  5. const highp vec2 offset2 = vec2(-0.2,  0.2);
  6. const highp vec2 offset3 = vec2( 0.2, -0.2);
  7. const highp vec2 offset4 = vec2( 0.2,  0.2);
  8.  
  9. uniform sampler2D textureSample;
  10.  
  11. #define sample(i) lowp vec4 sample##i = texture2D(textureSample, texCoord+offset##i)
  12.  
  13. void main()
  14. {
  15.     sample(0);
  16.     sample(1);
  17.     sample(2);
  18.     sample(3);
  19.    
  20.     gl_FragColor.g = sample1.g * 1.1 - sample2.b * 0.2 * sample1.r;
  21.     gl_FragColor.b = sample1.b * 1.1 - sample2.r * 0.2 * sample1.g;
  22.     gl_FragColor.r = sample1.r * 1.1 - sample2.g * 0.2 * sample1.b;
  23.     //gl_FragColor.r = 2.0/(gl_FragColor.r + 1.0) - 1.0;
  24.     gl_FragColor.rgb = vec3(1.0) - gl_FragColor.rgb;
  25.     gl_FragColor.a = 1.0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement