reverseLogDepth.js 464 B

12345678910111213
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "float czm_reverseLogDepth(float logZ)\n\
  3. {\n\
  4. #ifdef LOG_DEPTH\n\
  5. float near = czm_currentFrustum.x;\n\
  6. float far = czm_currentFrustum.y;\n\
  7. float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;\n\
  8. float depthFromNear = pow(2.0, log2Depth) - 1.0;\n\
  9. return far * (1.0 - near / (depthFromNear + near)) / (far - near);\n\
  10. #endif\n\
  11. return logZ;\n\
  12. }\n\
  13. ";