DepthViewPacked.js 581 B

1234567891011121314
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "uniform sampler2D u_depthTexture;\n\
  3. varying vec2 v_textureCoordinates;\n\
  4. void main()\n\
  5. {\n\
  6. float z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\n\
  7. z_window = czm_reverseLogDepth(z_window);\n\
  8. float n_range = czm_depthRange.near;\n\
  9. float f_range = czm_depthRange.far;\n\
  10. float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n\
  11. float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n\
  12. gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n\
  13. }\n\
  14. ";