writeDepthClamp.js 712 B

1234567891011121314151617181920212223242526
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "// emulated noperspective\n\
  3. #if !defined(LOG_DEPTH)\n\
  4. in float v_WindowZ;\n\
  5. #endif\n\
  6. \n\
  7. /**\n\
  8. * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane\n\
  9. * by writing the fragment's depth. See czm_depthClamp for more details.\n\
  10. *\n\
  11. * @name czm_writeDepthClamp\n\
  12. * @glslFunction\n\
  13. *\n\
  14. * @example\n\
  15. * out_FragColor = color;\n\
  16. * czm_writeDepthClamp();\n\
  17. *\n\
  18. * @see czm_depthClamp\n\
  19. */\n\
  20. void czm_writeDepthClamp()\n\
  21. {\n\
  22. #if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))\n\
  23. gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);\n\
  24. #endif\n\
  25. }\n\
  26. ";