                 czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),
                 czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),
                 u_morphTime);
-                
-        segmentMagnitude = usePrevDirection ? length(prev - p) : length(next - p);
-        
-        prevDir = vec4(normalize(prev.xyz - p.xyz), 0.0);
-        nextDir = vec4(normalize(next.xyz - p.xyz), 0.0);
-    }
-    
-    if (czm_equalsEpsilon(prevDir, vec4(0.0), czm_epsilon7))
-    {
-        prevDir = -nextDir;
-    }
-    
-    if (czm_equalsEpsilon(nextDir, vec4(0.0), czm_epsilon7))
-    {
-        nextDir = -prevDir;
     }
     
     vec4 endPointWC;
-    bool clipped;
     bool culledByNearPlane;
     
     vec4 positionEC = czm_modelViewRelativeToEye * p;
-    vec4 nextEC = vec4(normalize((czm_modelViewRelativeToEye * nextDir).xyz), 0.0);
-    vec4 prevEC = vec4(normalize((czm_modelViewRelativeToEye * prevDir).xyz), 0.0);
-    vec3 segmentDirection = (usePrevDirection) ? prevEC.xyz : nextEC.xyz;
+    vec4 prevEC = czm_modelViewRelativeToEye * prev;
+    vec4 nextEC = czm_modelViewRelativeToEye * next;
     
-    clipLineSegmentToNearPlane(positionEC.xyz, segmentDirection, segmentMagnitude, endPointWC, clipped, culledByNearPlane);
+    clipLineSegmentToNearPlane(positionEC.xyz, usePrev ? prevEC.xyz : nextEC.xyz, endPointWC, culledByNearPlane);
     
     if (culledByNearPlane)
     {

    float texCoord = texCoordExpandWidthAndShow.x;
    float expandDir = texCoordExpandWidthAndShow.y;
    float width = abs(texCoordExpandWidthAndShow.z) + 0.5;
    bool usePrevDirection = texCoordExpandWidthAndShow.z < 0.0;
    float show = texCoordExpandWidthAndShow.w;
    
    vec4 p, prev, next;
    vec4 prevDir;
    vec4 nextDir;
    
    float segmentMagnitude;

    if (u_morphTime == 1.0)
    {
        p = vec4(czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), 1.0);
        prev = vec4(czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), 1.0);
        next = vec4(czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), 1.0);
        
        segmentMagnitude = usePrevDirection ? length(prev - p) : length(next - p);
        
        prevDir = vec4(normalize(prev.xyz - p.xyz), 0.0);
        nextDir = vec4(normalize(next.xyz - p.xyz), 0.0);
    }
    else if (u_morphTime == 0.0)
    {
        p = vec4(czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), 1.0);
        prev = vec4(czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), 1.0);
        next = vec4(czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), 1.0);
        
        segmentMagnitude = usePrevDirection ? length(prev - p) : length(next - p);
        
        prevDir = vec4(normalize(prev.xyz - p.xyz), 0.0);
        nextDir = vec4(normalize(next.xyz - p.xyz), 0.0);
    }
    else
    {

        return;
    }
    
    float expandWidth = width * 0.5;
    vec4 p0, p1;
    vec2 direction, nextWC, prevWC;
    
    if (czm_equalsEpsilon(normalize(prev.xyz - p.xyz), vec3(0.0), czm_epsilon3))
    {
        p1 = czm_eyeToWindowCoordinates(vec4(nextEC.xyz, 1.0));
        nextWC = normalize(p1.xy - endPointWC.xy);
        direction = normalize(vec2(-nextWC.y, nextWC.x));
    }
    else if (czm_equalsEpsilon(normalize(next.xyz - p.xyz), vec3(0.0), czm_epsilon3))
    {
        p0 = czm_eyeToWindowCoordinates(vec4(prevEC.xyz, 1.0));
        prevWC = normalize(p0.xy - endPointWC.xy);
        direction = normalize(vec2(prevWC.y, -prevWC.x));
    }
    else
    {
	    p0 = czm_eyeToWindowCoordinates(vec4(prevEC.xyz, 1.0));
	    p1 = czm_eyeToWindowCoordinates(vec4(nextEC.xyz, 1.0));
	    
	    prevWC = normalize(p0.xy - endPointWC.xy);
	    nextWC = normalize(p1.xy - endPointWC.xy);
