Depth texture

The scene is drawn into a RenderTarget with depth: 'texture'. Besides the colour, the GPU's depth buffer is now a texture a shader can read. A second pass shows both, colour on the left of the split and depth on the right; move the pointer to move the split. The depth buffer does not store distance in a straight line, so raw depth looks almost white everywhere; linearized undoes the perspective projection. The white background is the far plane.

← all examples