srgbToLinear.js 540 B

123456789101112131415161718
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "/**\n\
  3. * Converts an sRGB color to a linear RGB color.\n\
  4. *\n\
  5. * @param {vec3|vec4} srgbIn The color in sRGB space\n\
  6. * @returns {vec3|vec4} The color in linear color space. The vector type matches the input.\n\
  7. */\n\
  8. vec3 czm_srgbToLinear(vec3 srgbIn)\n\
  9. {\n\
  10. return pow(srgbIn, vec3(2.2));\n\
  11. }\n\
  12. \n\
  13. vec4 czm_srgbToLinear(vec4 srgbIn) \n\
  14. {\n\
  15. vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n\
  16. return vec4(linearOut, srgbIn.a);\n\
  17. }\n\
  18. ";