fragment.glsl 654 B

12345678910111213141516171819202122232425262728
  1. #version 130
  2. //in vec2 texCoordOut;
  3. uniform sampler2D image;
  4. varying float z;
  5. in vec2 outTexCoord;
  6. void main()
  7. {
  8. //Apply color
  9. //gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
  10. gl_FragColor = gl_Color;
  11. gl_FragColor += texture2D(image, outTexCoord);
  12. //Apply a small red shade on the right side of the screen
  13. //float shade = 0.02f *(gl_FragCoord.x /100.0);
  14. //gl_FragColor.r += shade;
  15. //gl_FragColor.b += shade/2;
  16. //Apply some fade-out on far away objects
  17. //float fadeout = 0.2f *(z /30.0f);
  18. //gl_FragColor.r -= fadeout *0.7f;
  19. //gl_FragColor.g -= fadeout *0.9f;
  20. //gl_FragColor.b -= fadeout *1.0f;
  21. //gl_FragColor = texture(image, texCoordOut);
  22. }