ModifiedReinhardTonemapping.js 639 B

1234567891011121314151617181920
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "uniform sampler2D colorTexture;\n\
  3. uniform vec3 white;\n\
  4. varying vec2 v_textureCoordinates;\n\
  5. #ifdef AUTO_EXPOSURE\n\
  6. uniform sampler2D autoExposure;\n\
  7. #endif\n\
  8. void main()\n\
  9. {\n\
  10. vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\n\
  11. vec3 color = fragmentColor.rgb;\n\
  12. #ifdef AUTO_EXPOSURE\n\
  13. float exposure = texture2D(autoExposure, vec2(0.5)).r;\n\
  14. color /= exposure;\n\
  15. #endif\n\
  16. color = (color * (1.0 + color / white)) / (1.0 + color);\n\
  17. color = czm_inverseGamma(color);\n\
  18. gl_FragColor = vec4(color, fragmentColor.a);\n\
  19. }\n\
  20. ";