Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #ifdef GL_ES
  2. #define MED mediump
  3. #else
  4. #define MED
  5. #endif
  6.  
  7. attribute vec4 a_position;
  8. attribute vec2 a_texCoord0;
  9. uniform vec2 dir;
  10. uniform vec2 size;
  11. varying MED vec2 v_texCoords0;
  12. varying MED vec2 v_texCoords1;
  13. varying MED vec2 v_texCoords2;
  14. varying MED vec2 v_texCoords3;
  15. varying MED vec2 v_texCoords4;
  16. const vec2 futher = vec2(3.2307692308, 3.2307692308);
  17. const vec2 closer = vec2(1.3846153846, 1.3846153846);
  18. void main()
  19. {
  20. vec2 sizeAndDir = dir / size;
  21. vec2 f = futher*sizeAndDir;
  22. vec2 c = closer*sizeAndDir;
  23.  
  24. v_texCoords0 = a_texCoord0 - f;
  25. v_texCoords1 = a_texCoord0 - c;
  26. v_texCoords2 = a_texCoord0;
  27. v_texCoords3 = a_texCoord0 + c;
  28. v_texCoords4 = a_texCoord0 + f;
  29.  
  30. gl_Position = a_position;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement