CustomDepthMaterial on Meshline not working

Hi everyone!
I have a problem to draw correctly the depth of my meshlines in the depthbuffer resulting to the meshlines draw on top of each others ignoring the depth and just by order of drawing.

All the positioning of the vertex of the meshlines is done in the vertexshader.

my customDepthMaterial vertex shader looks like this :

 precision highp float;

#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;

uniform sampler2D positions;

attribute mediump vec2 ID;
attribute mediump vec2 prevID;
attribute mediump vec2 nextID;
attribute lowp float side;
attribute lowp vec3 color;
varying highp vec2 vUv;

uniform lowp vec2 resolution;
varying lowp vec4 vColor;
uniform highp float lineWidth;

vec2 fix( vec4 i, float aspect ) {
    vec2 res = i.xy / i.w;
    res.x *= aspect;
    return res;
}

void main() {
    // vColor = vec4(color, texture2D(positions,ID).a);
    vColor = vec4(color, 1.);
    vUv = uv;

    float aspect = resolution.x / resolution.y;

    mat4 m = projectionMatrix * modelViewMatrix;
    vec4 finalPosition = m * vec4( texture2D(positions,ID).rgb, 1.0 );
    vec4 prevPos = m * vec4( texture2D(positions,prevID).rgb, 1.0 );
    vec4 nextPos = m * vec4( texture2D(positions,nextID).rgb, 1.0 );

    vec2 prevP = fix( prevPos, aspect );
    vec2 nextP = fix( nextPos, aspect );

    vec2 dir = normalize( nextP - prevP );
    finalPosition.xy += vec2( -dir.y/aspect, dir.x ) * lineWidth * side;

    gl_Position = finalPosition;

    #include <logdepthbuf_vertex>
    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
    #include <clipping_planes_vertex>
    vHighPrecisionZW = finalPosition.zw;
}

and the fragment like this :

precision highp float;

#include <common>
#include <packing>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying highp vec2 vUv;

uniform sampler2D texture;
uniform float time;

varying vec2 vHighPrecisionZW;
varying lowp vec4 vColor;

void main() {
    float alpha = smoothstep(0.,0.15,vUv.x);
    alpha *= 1. - smoothstep(.85,1.,vUv.x);
    // vec4 t = texture2D(texture,vec2( vUv.x - time, vUv.y ));

    // if(vColor.a * alpha< 0.1){ discard; }

    vec4 diffuseColor = vec4( 1.0 );
    #include <logdepthbuf_fragment>
    float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
    gl_FragColor = packDepthToRGBA( fragCoordZ );
}

Is there something im doing obviously wrong here ?

Thanks in advance!