     materialInput.height = v_height;
     czm_material material = czm_getMaterial(materialInput);
     color.xyz = mix(color.xyz, material.diffuse, material.alpha);
-#endif
-
-#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
-    float cameraDist;
-    if (czm_sceneMode == czm_sceneMode2D)
-    {
-        cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
-    }
-    else if (czm_sceneMode == czm_sceneModeColumbusView)
-    {
-        cameraDist = -czm_view[3].z;
-    }
-    else
-    {
-        cameraDist = length(czm_view[3]);
-    }
-    float fadeOutDist = u_lightingFadeDistance.x;
-    float fadeInDist = u_lightingFadeDistance.y;
-    if (czm_sceneMode != czm_sceneMode3D) {
-        vec3 radii = czm_getWgs84EllipsoidEC().radii;
-        float maxRadii = max(radii.x, max(radii.y, radii.z));
-        fadeOutDist -= maxRadii;
-        fadeInDist -= maxRadii;
-    }
-    float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
 #endif
 
 #if defined(ENABLE_VERTEX_LIGHTING)

    vec3 normalEC = czm_normal3D * normalMC;                                         // normalized surface normal in eye coordiantes
#endif

#ifdef SHOW_REFLECTIVE_OCEAN
    vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
    vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;

}

vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);

void main()
{
