BasicMaterialAppearanceFS.js 783 B

12345678910111213141516171819202122232425
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "in vec3 v_positionEC;\n\
  3. in vec3 v_normalEC;\n\
  4. \n\
  5. void main()\n\
  6. {\n\
  7. vec3 positionToEyeEC = -v_positionEC;\n\
  8. \n\
  9. vec3 normalEC = normalize(v_normalEC);\n\
  10. #ifdef FACE_FORWARD\n\
  11. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\
  12. #endif\n\
  13. \n\
  14. czm_materialInput materialInput;\n\
  15. materialInput.normalEC = normalEC;\n\
  16. materialInput.positionToEyeEC = positionToEyeEC;\n\
  17. czm_material material = czm_getMaterial(materialInput);\n\
  18. \n\
  19. #ifdef FLAT\n\
  20. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\
  21. #else\n\
  22. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n\
  23. #endif\n\
  24. }\n\
  25. ";