AcesTonemappingStage.glsl 461 B

123456789101112131415161718192021
  1. uniform sampler2D colorTexture;
  2. varying vec2 v_textureCoordinates;
  3. #ifdef AUTO_EXPOSURE
  4. uniform sampler2D autoExposure;
  5. #endif
  6. void main()
  7. {
  8. vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);
  9. vec3 color = fragmentColor.rgb;
  10. #ifdef AUTO_EXPOSURE
  11. color /= texture2D(autoExposure, vec2(0.5)).r;
  12. #endif
  13. color = czm_acesTonemapping(color);
  14. color = czm_inverseGamma(color);
  15. gl_FragColor = vec4(color, fragmentColor.a);
  16. }