Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifdef GL_ES
  2.     precision mediump float;
  3. #endif
  4.  
  5. varying vec4 v_color;
  6. varying vec2 v_texCoords;
  7.  
  8. uniform float smew;
  9. uniform sampler2D u_texture;
  10.  
  11. vec2 distort(vec2 p) {
  12.     float x = sin( 25.0*p.y + 30.0*p.x + 6.28) * 0.01;
  13.     float y = sin( 25.0*p.y + 30.0*p.x + 6.28) * 0.01;
  14.     return vec2(p.x + x, p.y + y);
  15. }
  16.  
  17. void main()
  18. {
  19.     float width = 0.2;
  20.     vec4 color = v_color * texture2D(u_texture, distort(v_texCoords));
  21.     if ((v_texCoords.x < v_texCoords.y + smew + width) && (v_texCoords.x > v_texCoords.y + smew - width)) {
  22.         color *= 2.0;
  23.     }
  24.     gl_FragColor = color;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement