Fix depth buffer calculation.