Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | //This file is automatically rebuilt by the Cesium build process.
export default "in vec3 v_positionMC;\n\
in vec3 v_positionEC;\n\
in vec2 v_st;\n\
\n\
void main()\n\
{\n\
czm_materialInput materialInput;\n\
\n\
vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n\
#ifdef FACE_FORWARD\n\
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\
#endif\n\
\n\
materialInput.s = v_st.s;\n\
materialInput.st = v_st;\n\
materialInput.str = vec3(v_st, 0.0);\n\
\n\
// Convert tangent space material normal to eye space\n\
materialInput.normalEC = normalEC;\n\
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n\
\n\
// Convert view vector to world space\n\
vec3 positionToEyeEC = -v_positionEC;\n\
materialInput.positionToEyeEC = positionToEyeEC;\n\
\n\
czm_material material = czm_getMaterial(materialInput);\n\
\n\
#ifdef FLAT\n\
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\
#else\n\
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n\
#endif\n\
}\n\
";
|