BasicMaterialAppearanceFS.js 717 B

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