ShaderMaterial and Logarithmic Depth Buffer

Starting from 5.0 you can use your own material to render a mesh with the depth renderer.

So, simply call depthRenderer.setMaterialForRendering(yourMesh, yourMesh.material) and you should be good.

You could also optimize things by providing a specific material instead of the true one of the mesh, where only the logarithmic depth is enabled, because the depth renderer is only interested in generating a depth value - the color value computed by the fragment shader is not used.