writeDepthClamp.js 686 B

123456789101112131415161718192021222324252627
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "// emulated noperspective\n\
  3. #ifndef LOG_DEPTH\n\
  4. varying float v_WindowZ;\n\
  5. #endif\n\
  6. /**\n\
  7. * Clamps a vertex to the far plane by writing the fragments depth.\n\
  8. * <p>\n\
  9. * The shader must enable the GL_EXT_frag_depth extension.\n\
  10. * </p>\n\
  11. *\n\
  12. * @name czm_writeDepthClamp\n\
  13. * @glslFunction\n\
  14. *\n\
  15. * @example\n\
  16. * gl_FragColor = color;\n\
  17. * czm_writeDepthClamp();\n\
  18. *\n\
  19. * @see czm_depthClamp\n\
  20. */\n\
  21. void czm_writeDepthClamp()\n\
  22. {\n\
  23. #if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\n\
  24. gl_FragDepthEXT = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);\n\
  25. #endif\n\
  26. }\n\
  27. ";