Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 14th, 2012  |  syntax: None  |  size: 0.42 KB  |  hits: 19  |  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. Vertex shader:
  2.  
  3. void main() {
  4.   gl_Position = ftransform();
  5. }
  6.  
  7.  
  8. Fragment shader:
  9.  
  10. uniform float width;
  11. uniform float height;
  12.  
  13. void main() {
  14.   vec4 f2;
  15.   vec4 f3;
  16.   vec4 f0;
  17.   vec4 f1;
  18.   f0.xy=gl_FragCoord.xy;
  19.   f0.z=width;
  20.   f0.w=height;
  21.   f2.x=1.0;
  22.   f2.y=1.0;
  23.   f2.z=1.0;
  24.   f2.w=1.0;
  25.   f3.x=1.0/f0.z;
  26.   f3.x=f3.x*f0.x;
  27.   f2.x=f3.x;
  28.   f3.x=1.0/f0.w;
  29.   f3.x=f3.x*f0.y;
  30.   f2.y=f3.x;
  31.   gl_FragColor=f2;
  32. }