     culledByNearPlane = false;
     clipped = false;
     
-    vec3 normal = vec3(0.0, 0.0, -1.0);
-    vec3 point = normal * czm_currentFrustum.x;
-    vec4 plane = vec4(normal, -dot(normal, point));
-    
-    float endPoint0Distance = dot(plane.xyz, positionEC) + plane.w;
-    float denominator = dot(plane.xyz, directionEC);
+    float endPoint0Distance =  -(czm_currentFrustum.x + positionEC.z);
+    float denominator = -directionEC.z;
     
     if (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)
     {

    
    if (clipped)
    {
        if (usePrevDirection)
        {
            nextDir = -prevDir;
        }
        else
        {
            prevDir = -nextDir;
        }
    }
    
    float pixelSize = czm_pixelSizeInMeters * abs(positionEC.z);

    }
    else if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)
    {
        // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)
        float t = (czm_currentFrustum.x + positionEC.z) / denominator;
        if (t < 0.0 || t > magnitude)
        {
            culledByNearPlane = true;
