linearToSrgb.js 564 B

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