decompressTextureCoordinates.js 658 B

12345678910111213141516171819
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "/**\n\
  3. * Decompresses texture coordinates that were packed into a single float.\n\
  4. *\n\
  5. * @name czm_decompressTextureCoordinates\n\
  6. * @glslFunction\n\
  7. *\n\
  8. * @param {float} encoded The compressed texture coordinates.\n\
  9. * @returns {vec2} The decompressed texture coordinates.\n\
  10. */\n\
  11. vec2 czm_decompressTextureCoordinates(float encoded)\n\
  12. {\n\
  13. float temp = encoded / 4096.0;\n\
  14. float xZeroTo4095 = floor(temp);\n\
  15. float stx = xZeroTo4095 / 4095.0;\n\
  16. float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\n\
  17. return vec2(stx, sty);\n\
  18. }\n\
  19. ";