Logarithmic depth buffer

I've made experiments with the logarithmic depth buffer. Results are pretty cool, but there is a lot of work to do. For these screenshots I used astronaut and Discovery model from Doc's 2001 ships pack. Their sizes are real, not exaggerated as Doc originally made. No near plane clipping and no z-fighting.
This will be not enabled in the next patch by default, because full support of the log Z-buffer requires a lot of changes in the engine. There are two ways of using logarithmic Z-buffer: in the vertex shader and in the pixel shader. The first one gives artifacts on near or elongaetd triangles - their Z value are interpolated incorrectly (perspectively). The second method fixes that, but kills FPS to almost zero: SpaceEngine have a huge overdraw on planets, so disabling fast Z test (what is required for this method) makes complex planetary surface shader with atmospheric effect to apply to huge amount of pixels.
Anyway, I plan to implement a deferred shading pipeline in SpaceEngine, and logarithmic Z-buffer is the first step towards it. Deferred pipeline have a lot of benefits: fast Z-pass (that will speedup logarithmic Z buffer in a pixel shader), atmosphere as a post effect (that will speedup it a lot, because there will be no overdraw, and atmosphere will be applied to a planetary surface and ships that are inside the atmosphere), hundreds of lights (requires for ships at the first place), proper lens flare occlusion, and many other.