Advertisement
Guest User

gradient.frag

a guest
Jul 18th, 2013
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. uniform sampler2D texture;
  2.  
  3. void main()
  4. {
  5. vec4 pixel = gl_Color * texture2D(texture, gl_TexCoord[0].xy);
  6. vec2 pos = gl_TexCoord[0].xy;
  7.  
  8. pixel.a = .7+.29;
  9.  
  10. if( (pos.y*1536.0) > 768.0 )
  11. {
  12. pixel.a = 0.7*((256.0-((pos.y*1536.0)-1280.0))/768.0)+.29;
  13. }
  14.  
  15. if( (pos.y*1536.0) <= 768.0 )
  16. {
  17. pixel.a = 0.7*((pos.y*1536.0)/768.0)+.29;
  18. }
  19.  
  20. gl_FragColor = pixel;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement