All files / engine/Source/Shaders/Builtin/Functions decompressTextureCoordinates.js

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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