RGBToXYZ.js 373 B

1234567891011121314
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "vec3 czm_RGBToXYZ(vec3 rgb)\n\
  3. {\n\
  4. const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n\
  5. 0.3576, 0.7152, 0.1192,\n\
  6. 0.1805, 0.0722, 0.9505);\n\
  7. vec3 xyz = RGB2XYZ * rgb;\n\
  8. vec3 Yxy;\n\
  9. Yxy.r = xyz.g;\n\
  10. float temp = dot(vec3(1.0), xyz);\n\
  11. Yxy.gb = xyz.rg / temp;\n\
  12. return Yxy;\n\
  13. }\n\
  14. ";