TexturedMaterialAppearanceFS.js 767 B

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