A robot simulation exports a depth buffer whose values lie between zero and one. Those values do not necessarily increase uniformly with distance in meters. Under a conventional perspective mapping, the stored number is an affine function of reciprocal view-axis depth.

Equal increments in that number therefore correspond to different physical-depth increments near and far from the virtual camera. Reading it as normalized linear range can introduce a geometric error before any simulated sensor uncertainty is considered.

This article defines one graphics model explicitly. It does not describe every simulator export, depth camera format, or rendering pipeline. All numerical buffers are hypothetical.

Name the depth coordinate and the mapping

Let z be positive distance along the virtual camera's viewing axis. Let n and f be positive near- and far-plane distances, with n less than f. Restrict attention to n ≤ z ≤ f.

Define stored depth d by:

d(z) = f/(f − n) − fn/[(f − n)z].

This maps z = n to d = 0 and z = f to d = 1. It increases monotonically with z but is not linear in z.

NVIDIA's authored Visualizing Depth Precision article describes stored perspective depth as a linear remapping of 1/z. Khronos' OpenGL 2.1 glFrustum reference describes perspective near and far planes and their effect on depth precision. These sources support the mapping context; the particular distances and integer format here are independently chosen.

The displayed zero-to-one convention is part of this model. Another pipeline can reverse it or export a different depth quantity entirely.

Half the stored interval can cover a short near segment

Choose n = 0.2 m and f = 20 m.

At z = 0.4 m, d is approximately 0.505051. At 1 m it is approximately 0.808081; at 2 m, 0.909091; and at 10 m, 0.989899.

The short segment from 0.2 to 0.4 m consumes slightly more than half of the stored depth interval. The much longer segment from 2 to 20 m occupies only about 0.090909 of that interval.

These are fractions of the mathematical depth range. Actual integer-code counts require the chosen quantizer. The observation already establishes that multiplying d by twenty meters is not the inverse of the defined transformation.

Invert the mapping before assigning metric meaning

Solving for z gives:

z(d) = fn/[f − (f − n)d].

At d = 0.5, the example returns approximately 0.396040 m. A linear interpolation between the near and far distances would instead give 10.1 m.

Both calculations map the endpoints correctly, yet they disagree dramatically inside the interval. Matching zero and one is not enough to identify the intervening mapping.

The inverse requires n and f, or equivalent projection information. A floating-point array type and a field named depth do not independently provide that definition.

A fixed-point buffer makes the spacing visible

Assume an original ideal 16-bit normalized integer depth buffer with codes k = 0 through Q, where Q = 65,535. Its represented normalized levels are d_k = k/Q.

Ignore projection arithmetic errors, rasterization details, and other implementation effects. To compare represented depths, apply the inverse mapping to these exact levels.

The first positive represented depth exceeds n by approximately 0.000003021332 m, or 3.021332 micrometers.

The next-to-last represented depth is approximately 19.969833 m, while the last is exactly 20 m. Their separation is approximately 0.03016729 m, or 30.16729 mm.

The same single-code interval corresponds to a few micrometers near the near plane and about thirty millimeters near the far plane in this constructed buffer.

Those are spacings between reconstructed levels. They are not complete error bounds for a rendered scene, and they do not identify a physical sensor's accuracy.

A local derivative explains the trend

Differentiate the inverse relationship with respect to d. Expressed at depth z, its derivative is:

dz/dd = (f − n)z squared/(fn).

For a sufficiently small normalized increment delta_d, the corresponding local depth increment is approximately that derivative times delta_d.

Using delta_d = 1/Q in the example gives approximately 0.075532 mm at z = 1 m and 7.553216 mm at z = 10 m. The depth increased by ten, and the local spacing estimate increased by one hundred.

This derivative calculation is a local approximation, not the exact finite interval between arbitrary adjacent codes. Near a region where the step is large, the inverse formula supplies the exact comparison.

Moving a clipping plane changes the allocation

Keep f = 20 m and the same sixteen-bit model, but change the hypothetical near plane from 0.2 to 1 m.

The final represented-level gap now becomes approximately 5.796748 mm, smaller than the earlier 30.16729 mm. The depth mapping has reassigned the finite set of stored levels.

However, the new interval excludes geometry between 0.2 and 1 m that the first model included. The numerical improvement does not come without changing the represented view volume.

This comparison is an explanation of allocation, not a recommended clipping setting for a robot simulator. A suitable rendering configuration depends on the geometry that must remain visible and the actual export contract.

Reversing numbers and changing the storage format differ

If equally spaced integer levels are simply reversed, mapping near to one and far to zero, their physical-depth spacing is mirrored in code order. Reversal alone does not create additional distinct fixed-point levels.

Floating-point formats distribute representable numbers nonuniformly. NVIDIA's article discusses how a reversed mapping interacts with that distribution. Those considerations concern another declared representation, rather than proving the integer calculation above applies to every depth format.

A simulator can also export already linearized metric depth. Applying the displayed inverse again to such an export would be incorrect. The quantity must be identified before selecting a formula.

View-axis depth is not necessarily ray range

In this model, z is distance along the viewing axis. A point at camera coordinates (6, 8, 10) m has z = 10 m but Euclidean distance approximately 14.142136 m from the camera origin.

Its stored value follows z, not that longer distance. A simulated range observation along a ray and a graphics depth value can therefore require different geometric interpretations.

For robot simulation records, preserving the projection, clip distances, representation, and depth convention makes the exported array understandable. The original calculation shows why uniformly spaced stored numbers do not establish uniformly spaced distances.

Sources checked October 23, 2026

Nathan Reed, NVIDIA Technical Blog, Visualizing Depth Precision, October 21, 2021; authored article body:

https://developer.nvidia.com/blog/visualizing-depth-precision/

KhronosGroup OpenGL reference pages, OpenGL 2.1 glFrustum, official repository main-branch edition as accessed:

https://raw.githubusercontent.com/KhronosGroup/OpenGL-Refpages/main/gl2.1/xhtml/glFrustum.xml

All clip distances, integer-level comparisons, and metric examples are original hypothetical analysis. No renderer or robot simulator was executed.

Illustration note: The accompanying site-library robot beside a laptop is a computing concept scene. It does not show a captured depth buffer, measured sensor range, or validated simulation fidelity.