You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 lines
601 B

  1. -- GLSL.Vert --
  2. #version 120
  3. void main()
  4. {
  5. gl_Position=gl_Vertex;
  6. gl_TexCoord[0]=gl_MultiTexCoord0;
  7. }
  8. -- GLSL.Frag --
  9. #version 120
  10. uniform sampler2D texture;
  11. uniform vec2 screen_size;
  12. uniform vec3 filter;
  13. uniform vec3 color;
  14. uniform float flash;
  15. void main(void)
  16. {
  17. vec2 p=gl_FragCoord.xy/screen_size.xy;
  18. vec3 c=texture2D(texture,p).xyz;
  19. float a=(c.x+c.y+c.z)/3.0;
  20. c=mix(c,vec3(a),color.z); // grayscale
  21. c*=filter; // filter
  22. c*=color.x; // brightness
  23. c=0.5+(c-0.5)*color.y; // contrast
  24. c+=flash; // flash
  25. gl_FragColor=vec4(c,1.0);
  26. }