sphericalHarmonics.js 848 B

12345678910111213141516171819202122232425
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])\n\
  3. {\n\
  4. const float c1 = 0.429043;\n\
  5. const float c2 = 0.511664;\n\
  6. const float c3 = 0.743125;\n\
  7. const float c4 = 0.886227;\n\
  8. const float c5 = 0.247708;\n\
  9. vec3 L00 = coefficients[0];\n\
  10. vec3 L1_1 = coefficients[1];\n\
  11. vec3 L10 = coefficients[2];\n\
  12. vec3 L11 = coefficients[3];\n\
  13. vec3 L2_2 = coefficients[4];\n\
  14. vec3 L2_1 = coefficients[5];\n\
  15. vec3 L20 = coefficients[6];\n\
  16. vec3 L21 = coefficients[7];\n\
  17. vec3 L22 = coefficients[8];\n\
  18. float x = normal.x;\n\
  19. float y = normal.y;\n\
  20. float z = normal.z;\n\
  21. return c1 * L22 * (x * x - y * y) + c3 * L20 * z * z + c4 * L00 - c5 * L20 +\n\
  22. 2.0 * c1 * (L2_2 * x * y + L21 * x * z + L2_1 * y * z) +\n\
  23. 2.0 * c2 * (L11 * x + L1_1 * y + L10 * z);\n\
  24. }\n\
  25. ";