Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. uniform sampler2D texture1;
  2. uniform sampler2D texture2;
  3. uniform sampler2D mask;
  4. uniform float angle;
  5. uniform mat2 textureMatrix;
  6. varying vec4 color;
  7.  
  8. void main() {
  9.  
  10. vec4 color1 = texture2D(texture1, gl_TexCoord[0].xy);
  11. vec4 color2 = texture2D(texture2, gl_TexCoord[0].xy);
  12.  
  13. //mat2 textureMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));
  14.  
  15. float mask = texture2D(mask, textureMatrix*gl_TexCoord[0].xy).a;
  16.  
  17. gl_FragColor = color * mix(color1, color2, mask);
  18.  
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement