You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
//This file is automatically rebuilt by the Cesium build process.
|
|
export default "varying vec3 v_positionEC;\n\
|
|
varying vec3 v_normalEC;\n\
|
|
varying vec3 v_tangentEC;\n\
|
|
varying vec3 v_bitangentEC;\n\
|
|
varying vec2 v_st;\n\
|
|
\n\
|
|
void main()\n\
|
|
{\n\
|
|
vec3 positionToEyeEC = -v_positionEC;\n\
|
|
mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\n\
|
|
\n\
|
|
vec3 normalEC = normalize(v_normalEC);\n\
|
|
#ifdef FACE_FORWARD\n\
|
|
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\
|
|
#endif\n\
|
|
\n\
|
|
czm_materialInput materialInput;\n\
|
|
materialInput.normalEC = normalEC;\n\
|
|
materialInput.tangentToEyeMatrix = tangentToEyeMatrix;\n\
|
|
materialInput.positionToEyeEC = positionToEyeEC;\n\
|
|
materialInput.st = v_st;\n\
|
|
czm_material material = czm_getMaterial(materialInput);\n\
|
|
\n\
|
|
#ifdef FLAT\n\
|
|
gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\
|
|
#else\n\
|
|
gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n\
|
|
#endif\n\
|
|
}\n\
|
|
";
|