Want more features on Pastebin? Sign Up, it's FREE!
Guest

gradient.frag

By: a guest on Jul 18th, 2013  |  syntax: None  |  size: 0.42 KB  |  views: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data