ContrastBias.js 613 B

12345678910111213141516
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "uniform sampler2D colorTexture;\n\
  3. uniform float contrast;\n\
  4. uniform float brightness;\n\
  5. varying vec2 v_textureCoordinates;\n\
  6. void main(void)\n\
  7. {\n\
  8. vec3 sceneColor = texture2D(colorTexture, v_textureCoordinates).xyz;\n\
  9. sceneColor = czm_RGBToHSB(sceneColor);\n\
  10. sceneColor.z += brightness;\n\
  11. sceneColor = czm_HSBToRGB(sceneColor);\n\
  12. float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\n\
  13. sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\n\
  14. gl_FragColor = vec4(sceneColor, 1.0);\n\
  15. }\n\
  16. ";