ReinhardTonemapping.js 590 B

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