The render is distorted on purpose
Worth reading first: Straight lines that are not · The point you have to stand at.
The lens field treats distortion as a nuisance. A real lens bends straight lines, destroys the cross-ratio, and is the largest systematic error in every measurement made from a photograph — so the field’s work is to model it, fit it and remove it.
A headset does the opposite. Its lens sits a few centimetres from a small panel and is doing a job that has nothing to do with imaging: it moves the panel’s apparent position out to a comfortable focal distance and spreads it across a large angle. Achieving that in a few centimetres of glass means accepting a great deal of distortion, and the accepted solution is not to fix the lens but to render the inverse of it.
So the same polynomial appears twice on this site with the sign of the intention reversed. Here it is not an error to be recovered. It is a specification, and the render is written to satisfy it.
The same function, used backwards
The lens field carries the Brown–Conrady polynomial:
and its inverse, computed by the fixed-point iteration every calibration library uses because there is no closed form — inverting a quintic in is not worth doing.
A pre-warp is that inverse applied deliberately. The renderer draws each point where the inverse says it should go; the lens moves it back where the polynomial says; and the composition is the identity. The gate asserts the round trip at px over a grid of fifty-four nodes.
That closure is not free and its limits are worth stating, because the phase found one of them while drawing this figure. The iteration is contractive only while the radial factor stays positive — past that the candidate lens folds the image over itself and there is no point to return. At a 90° frame with and , the corner of the frame is past it, and the round trip came back 110 px out at one end of the figure’s slider. The inverse is written with that warning attached: the failure at strong distortion is silent — the iteration wanders instead of diverging, and returns a point that is merely wrong.
So the figure draws the inner 86% of a 72° frame, which is the regime the inverse is exact in, and says so in its strip. That is the honest version. The alternative — a wider frame with a tolerance loose enough to accept 110 px — would be a figure asserting that a pre-warp works while drawing one that does not.
The cost, which is not the residual
The interesting quantity here is not how well the round trip closes — it closes to the noise floor — but what the pre-warp does to the density of samples across the field.
A warp that compresses part of the picture and stretches the rest delivers a non-uniform number of pixels per degree. Measure it directly: take a pair of points half a pixel apart in the rendered image, push both through the lens, and see how far apart they land.
At the centre of the field, one rendered pixel becomes 1.000 delivered pixels. At the edge it becomes 0.646. A ratio of 0.646, so the outer field is delivered at about two thirds the density of the centre — which means a render at uniform resolution is over-sampling the middle and under-sampling the rim, or under-sampling the middle and over-sampling the rim, depending on which one it was tuned for. Either way it is spending pixels somewhere they do not arrive.
The control is a pinhole, where the ratio is exactly 1 and the density is flat. The gate asserts both — the barrel lens’s ratio departs from 1 by more than a tenth, and the pinhole’s does not depart at all — and it asserts the second at a fixed coefficient rather than at the figure’s current one, because the claim is that a pre-warp costs resolution and not that this particular frame’s does.
That non-uniformity is why headset renderers do not render uniformly. Varying the resolution across the frame to match the warp is the direct response to this measurement, and it is a geometric optimisation rather than a perceptual one — it is spending pixels where they arrive rather than where they are looked at, which is a different and simpler argument than the one about the eye’s own acuity.
What the polynomial can and cannot express
A pre-warp is only as good as the model it inverts, and the Brown–Conrady polynomial is a model with a specific shape rather than a universal one. Two of its limits matter here and both are stated in the lens field already.
It is radial and tangential, so it cannot express anything else. A distortion that varies with azimuth in a way that is not a simple tangential term — a lens with an aspheric element slightly off centre, a panel not square to the optical axis — is outside the model, and the residual after pre-warping is whatever part of the real behaviour the polynomial could not reach.
And it is even in , which is why a lens destroys the cross-ratio: a projective map is a ratio of linear forms and an even polynomial is not one at any coefficient but zero. That is the fact that makes distortion a genuine departure from projection rather than another projection.
The second one has a pleasing consequence for the pre-warp. Since the distortion is not a projective map, its inverse is not either — so the picture a headset renders is genuinely not a perspective picture of the scene. It is a perspective picture pushed through a non-projective warp, and its cross-ratios are wrong, its straight lines are curved, and no camera could have produced it.
The composition is a projection; neither factor is. That is worth stating plainly because it is the only place on this site where an intermediate object is deliberately not a picture of anything, and the whole design depends on nobody ever looking at it.
Chromatic aberration is the third limit and the one that breaks the tidiness completely. The lens’s distortion is different for different wavelengths, so a single pre-warp cannot correct all of them; the standard response is three warps, one per colour channel, and even that is a three-point sample of a continuous function. There is no coefficient at which the correction is exact for white light, and this site’s machinery — which is monochrome by construction, because it computes geometry — has nothing to say about how well the three-sample approximation does.
Why this is not the same as correcting a photograph
Both operations apply the same polynomial and they are not the same operation, and the difference is worth stating because it decides what “correct” means in each case.
Correcting a photograph starts with a distorted picture and produces an undistorted one. The information was already recorded; the correction redistributes it. What is lost is the resampling — pixels that were densely sampled in one part of the frame get spread out, and the result has a resolution that varies even though the input did not.
Pre-warping a render starts with nothing and produces a distorted picture on purpose, so there is no resampling loss at all: every pixel is drawn where it is wanted, once, at full precision. What varies instead is the delivery — the density at which the drawn pixels arrive at the eye.
So the pre-warp is strictly better placed than the correction, and the reason is that a render can be evaluated anywhere. A photograph has already committed to a grid; a render has not. That is a real advantage of synthesised pictures over recorded ones and it is not a large class of advantages — most of the time a render is imitating a recording.
What the composition is a projection of
The question this site always asks. A headset draws a pre-warped picture; a lens distorts it; an eye looks at the result. Is the composite a projection of anything from anywhere?
Yes, exactly, and that is the point of the whole arrangement. The pre-warp is the inverse of the distortion, so the composition of the two is the identity, and what remains is an ordinary pinhole picture viewed from the position the optics put the eye at. The headset’s whole optical design is an argument for a very short viewing distance, and the pre-warp is what makes the picture correct from there.
That is a stronger claim than this site can usually make about a real instrument. A refracted picture has no viewpoint; a lens breaks the invariant; a rolling shutter has no centre. A pre-warped render through the lens it was warped for is a projection through a point, to px, because it was designed to be.
The two qualifications are the ones this essay has already made. It holds only where the inverse converges, which is a stated region of the field. And it holds for the nominal lens: the pre-warp is computed from a model, and any departure of the actual glass from that model survives uncorrected, in the same way and for the same reason that an uncalibrated camera’s distortion survives.
Where the two projections in a headset are
The screen field’s framing is that a picture is projected twice — once by the camera and once off the display. A headset has both and its second projection is unusually well specified, which is worth setting out because it is the reason the pre-warp is possible at all.
The optics put the panel at an apparent distance and size: typically a couple of metres away and a couple of metres across, so the panel subtends the ninety-odd degrees the headset advertises. That apparent screen is the picture, and the eye is at a fixed distance from it because the eye is a fixed distance from the lens.
So the second projection’s station point is known in advance and constant, which is what no other display in the field can say. A monitor’s station point depends on how far back a chair is; a phone’s on the length of an arm. A headset’s is a property of the device.
Which is why the render can be pre-warped at all. The warp is computed for one eye position, and correcting for a different one would need the pre-warp recomputed. That is exactly what a headset does when it tracks the eye’s position within the lens, and the fact that it has to is the clearest evidence that the pre-warp is a viewpoint-dependent correction rather than an image-processing step.
A pre-warp is therefore a piece of the same argument the rest of this field makes: it is a correction that only works from one place, applied by a device that guarantees the viewer is at that place. Which makes it the same shape as an anamorph — a projection with its viewpoint enforced — with the enforcement done by a headband instead of by a marked spot on a floor.
The correction has to be applied last
A small ordering fact that follows from everything above and is easy to get wrong.
The pre-warp is a map from image coordinates to image coordinates, so it has to be applied to a finished picture. Anything computed before it — the projection, the depth test, the occlusion — happens in the undistorted picture, because those are the operations that need a real projection to work on.
That is not a preference. A depth buffer compares along rays and the rays are the projection’s; a clipper cuts against planes that are planes only in the undistorted picture; and perspective-correct interpolation assumes a projective map, which the warp is not. Every one of the pipeline field’s four departures is defined against a projection, and the pre-warp is the one step that is not a projection at all.
So the order is fixed: project, clip, test, interpolate, then warp. And the warp being last is why it costs resolution rather than correctness — it is resampling a finished picture, so the only thing it can lose is samples.
The one place on this site where distortion is a specification
Worth stating as a closing thought, because it is a genuine inversion of the site’s usual stance and inversions are where the assumptions show.
Every other essay treats a departure from the pinhole as something to be measured, bounded and where possible removed. Refraction is measured as a difference from a pinhole. A lens is fitted so it can be undone. A scroll is measured on what it preserves rather than repaired, but the measuring is still against the pinhole’s battery.
Here the departure is chosen, specified in advance, and satisfied. And the thing that makes it work is exactly the thing that makes the lens field’s fits possible: the departure is a model with parameters, so it can be inverted. A departure nobody has modelled cannot be pre-warped, cannot be corrected, and cannot be compensated for — which is a good general statement of what a model buys, and why the fleet’s habit of generating every figure from a stated rule is worth the trouble.
What links here
Computed from the collection, not written here: the essays that point at this one.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- The pixel that is not square — both name anisotropy, camera calibration, demonstration, residual
- A frame is an interval — both name demonstration, instrument limit, residual
- A pixel is not a point — both name camera calibration, demonstration, residual
- The precision a depth buffer has left — both name demonstration, instrument limit, residual
- A focal length is not an angle — both name demonstration, field of view
- A wide field on a small screen — both name demonstration, field of view
Named objects
A flat tag is an object no other essay names yet.
AnisotropyBarrel distortionBrown–ConradyCamera calibrationDemonstrationfield of viewinstrument limitInverse projectionRadial distortionResidual