     #include light
 
     #ifdef PICKING
-        // TODO compare without sqrt
-        if( distance( new_point, end_cyl) < distance( new_point, base ) ){
+        if( distSq3( new_point, end_cyl ) < distSq3( new_point, base ) ){
             if( b < 0.0 ){
                 gl_FragColor = vec4( vPickingColor, objectId );
             }else{

#include fog_params


// round caps
// http://sourceforge.net/p/pymol/code/HEAD/tree/trunk/pymol/data/shaders/cylinder.fs


            }
        }
    #else
        if( distSq3( new_point, end_cyl ) < distSq3( new_point, base ) ){
            if( b < 0.0 ){
                gl_FragColor = vec4( vColor, opacity );
            }else{
