BlackAndWhite.js 584 B

12345678910111213141516171819
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "uniform sampler2D colorTexture;\n\
  3. uniform float gradations;\n\
  4. varying vec2 v_textureCoordinates;\n\
  5. void main(void)\n\
  6. {\n\
  7. vec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\n\
  8. #ifdef CZM_SELECTED_FEATURE\n\
  9. if (czm_selected()) {\n\
  10. gl_FragColor = vec4(rgb, 1.0);\n\
  11. return;\n\
  12. }\n\
  13. #endif\n\
  14. float luminance = czm_luminance(rgb);\n\
  15. float darkness = luminance * gradations;\n\
  16. darkness = (darkness - fract(darkness)) / gradations;\n\
  17. gl_FragColor = vec4(vec3(darkness), 1.0);\n\
  18. }\n\
  19. ";