SHARE
TWEET

gradient.frag

a guest Jul 18th, 2013 6 Never
  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. }
RAW Paste Data
Top