TexturedMaterialAppearanceFS.js 832 B

123456789101112131415161718192021222324252627
  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. in vec2 v_st;\n\
  5. \n\
  6. void main()\n\
  7. {\n\
  8. vec3 positionToEyeEC = -v_positionEC;\n\
  9. \n\
  10. vec3 normalEC = normalize(v_normalEC);\n\
  11. #ifdef FACE_FORWARD\n\
  12. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\
  13. #endif\n\
  14. \n\
  15. czm_materialInput materialInput;\n\
  16. materialInput.normalEC = normalEC;\n\
  17. materialInput.positionToEyeEC = positionToEyeEC;\n\
  18. materialInput.st = v_st;\n\
  19. czm_material material = czm_getMaterial(materialInput);\n\
  20. \n\
  21. #ifdef FLAT\n\
  22. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\
  23. #else\n\
  24. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n\
  25. #endif\n\
  26. }\n\
  27. ";