getLambertDiffuse.js 911 B

123456789101112131415161718192021222324
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "/**\n\
  3. * Calculates the intensity of diffusely reflected light.\n\
  4. *\n\
  5. * @name czm_getLambertDiffuse\n\
  6. * @glslFunction\n\
  7. *\n\
  8. * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n\
  9. * @param {vec3} normalEC The surface normal in eye coordinates.\n\
  10. *\n\
  11. * @returns {float} The intensity of the diffuse reflection.\n\
  12. *\n\
  13. * @see czm_phong\n\
  14. *\n\
  15. * @example\n\
  16. * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\n\
  17. * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\n\
  18. * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\n\
  19. */\n\
  20. float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n\
  21. {\n\
  22. return max(dot(lightDirectionEC, normalEC), 0.0);\n\
  23. }\n\
  24. ";