Every essay — page 17
What survives Constructing a view Where to stand Surfaces that are not flat The other systems Light and mirrors Mirrors that are not cameras Measuring from one picture Through water and glass The real instrument The second eye What a pair is for Many pictures at once The eye that moves Systems that kept the measure What each system gave up What a machine computes The rectangle behind the lens The second projection Drawn confidently
What a machine computes
A renderer does not divide by depth and stop. It multiplies by a matrix and postpones the divide, clips while the points behind the eye are still finite, quantises what it kept, and lands on a grid of samples half a pixel from where the arithmetic put them. Each of those is a decision about what the picture is a projection of, and each has a number attached.
A tilted span walks a staircase
A span along a banked floor's constant-depth direction is exact, and a renderer visits pixels rather than the span. Snapped to the grid, a 120 px span at a 20° bank costs 0.577 px where the same span along a page row costs 13.26 — twenty-three times better — and it never rises above 1.22 px at any bank. The price is bookkeeping: a band of twenty-four such spans draws 53 of its 1,368 pixels twice.
One warped shadow map, and what it cannot reach
The lamp facing the eye needed a shadow map 9,530 texels square — 90.8 million texels — for none of them to land on the near floor larger than a pixel. Fitted to the floor and warped by one projective parameter, the same map needs 805 thousand; nothing can do better than one texel per pixel of the eye's picture, 148 thousand. What stays out of reach is not the cosine of a surface, which a warp absorbs, but two surfaces that want different densities along one ray from the lamp.
A texture reaches the horizon as a rate
A ground drawn to infinity cannot carry a texture coordinate at its far corners, because a repeating texture has no coordinate there. It can carry a rate — so many checks per metre along the direction — and a second number that is 1 at points and 0 at directions. Interpolated like every other attribute and divided once, that pair is exact half a pixel from the horizon. Give the same corner a value instead and the ground is drawn in reverse perspective.
One homography makes a shadow map the eye's picture
A shadow map for a lamp facing the eye needed 706 thousand texels however its rows were re-spaced, nearly five times the one texel per pixel no map can beat. Warp the whole map by a projective transformation, not only its rows, and it needs 154 thousand — within five per cent of the bound — and every texel, carried into the eye's picture, lands at one pixel. The reason is exact: the eye's picture of a floor and the lamp's picture of the same floor are one homography apart.
A sky is carried as a direction
A triangle of sky has all three vertices at infinity, so the weight that lets a texture reach the horizon is zero everywhere and there is nothing to divide by. The attribute that belongs to such a triangle is the direction itself: carried over w like any other, it is every pixel's own ray to 5e-14 degrees. Carry the vertices' azimuth and elevation instead and a 60° triangle is 7.7° out, a 4096-texel sky needs triangles under ten degrees wide, and a triangle across the seam where azimuth wraps is painted with the opposite sky.
Ground and sky meet at the horizon without a crack
A ground of rate triangles and a sky of direction triangles share their vertices along the horizon, and rasterised as a graphics processor does it — positions snapped to a fraction of a pixel, every centre given to one triangle by the top-left rule — they lose no pixel and claim none twice, at any roll and any snapping. What the horizon does have is a sliver: a centre that falls within half a snapping step of it goes to whichever side the snapped edge puts it, and one that falls exactly on it, rolled one way, is given to the ground at a weight of zero. A ground stopped at a far plane leaves the crack the shared vertex never does: f·h/D rows.
A ground and a sky share an elevation, not a distance
Read from its own attribute — the ground's rate and weight, the sky's direction — each side of a rasterised horizon reports the elevation of its pixels' rays to 2.2 millionths of a radian, in 32-bit arithmetic as in 64, so a haze painted by elevation crosses the edge without a seam. A fog by distance cannot, and should not: the ground a row below a walker's horizon is 1.2 kilometres away, and at thirty kilometres of visibility the fog steps by 0.85 in one row. A camera's pixel, averaging its area, records a step of 0.69.
Halving a picture moves its centre by a quarter of a pixel
Multiply a principal point by the scale of a resize and it comes out wrong by (s − 1)/2 of a new pixel, at any point and for every reduction. At a pyramid's fourth level that is nearly half a pixel, turning a recovered pose by half a degree. The picture, asked, reports the true map.
A fog band softens the horizon only by repainting the ground
Carry the sky's full haze a few rows down into a distance-fogged ground and the step at a walker's horizon is not removed but spread into a ramp, whose steepest row changes by about one and a half over the band's width of the whole rise. Two rows barely move a step of 0.63; softening it to the unaided horizon of an eye 150 metres up takes 32 rows at every visibility from one kilometre to thirty — and repaints all the ground beyond forty metres hazier than it is. The choice between an honest distance fog and a seamless horizon is real. What four rows of band do buy is the shimmer: the last row's saw-tooth falls from 0.061 a column to 0.012.
A rounded viewport has two focal lengths
Compute the aspect ratio from a window's requested size and draw into a buffer of whole device pixels, and the picture has two focal lengths that differ by up to one part in three hundred. It looks like a defect that should grow worse on small screens and better on large ones. At the frame's edge it does neither, because the error is a bounded displacement of a fraction of a pixel on any window at all.
Jittered frames rebuild a camera's horizon, saw-tooth and all
A renderer that moves its sample a fraction of a pixel every frame and averages the frames turns each pixel's single sample into an average over the pixel's area — which is what a camera's pixel records. Along a hazy, rolled horizon that removes the quarter of the shimmer point sampling adds, 0.082 a column down to 0.061, and stops there: eight Halton frames are within a hundredth of the camera, and sixty-four are no better. The rest of the saw-tooth is the camera's own, and so is the horizon's step. Only a band of repainted ground goes below them, and jitter's own price is a flicker of 0.29 a frame until a history averages it away.
A rolling horizon outruns the history that was meant to quiet it
Jittered frames averaged in a history draw a still hazy horizon as a camera does, four times nearer than one centred sample. Roll the camera and the history has to follow. Left in place, it is worse than no anti-aliasing at all from a degree a second. Reprojected exactly through the roll, it still reads last frame's picture between pixels, and an interpolated step is a softened step, softened again every frame: past one and a half degrees a second the history sits further from the camera than a single centred sample, and at sixteen it paints the first row of ground as sky. No blend fixes both its error and its pops. Four rows of band move with the horizon popping a fortieth as much — at the price of a quarter of the fog's range in repainted ground.
A clamp keeps the sky clean and leaves the rolling horizon smeared
Clamping a jittered history to the range of each pixel's neighbours is the renderer's standard guard against a moving edge smearing, and on a rolling horizon it does half the job. Two rows from the horizon, where the neighbours agree, it pulls the smear back at once: a sky row the history had darkened to 0.88 is restored to 0.99. On the rows the horizon crosses, the nine neighbours hold sky and ground together, the window runs from 0.12 to 1.00, and the smear passes through it untouched. The crossing with a plain centred sample moves from 1.5° a second of roll to 1.8; at 16° a second the history is 0.070 from a camera instead of 0.093, still nearly three times a centred sample's 0.025. And a clip tight enough to reach the smear brings the jitter back: on a still camera it pops four times as hard.
Through water and glass
A refracted picture is not a projection at all — its rays, continued into the water, miss each other by millimetres rather than meeting at a point. Everything the other fields rest on is measured here against the case where it fails, from the cross-ratio to Snell's window to a dome port that turns out to be an exact pinhole.
What a ray does at a surface
A pool looks three-quarters as deep as it is — but only if you look straight down. At sixty degrees the same bottom appears at half its depth, and at eighty at a fifth, which is why the far end of a pool looks shallow enough to walk in.
A picture through water has no viewpoint
Continue the rays of a refracted picture into the water and fit them to a common point. They miss it by ten millimetres. The same fit with the water taken away misses by zero, which is what makes ten millimetres a measurement rather than a number.
What survives a pane of glass
A slab of glass moves every point of a picture and moves no direction at all. So the camera recovered from a photograph taken through a display case is exactly the camera that took it — out of a picture in which nothing is where it was.
The sky inside a cone
From under water the whole sky — every direction out to the horizon — arrives inside a cone of 48.61°. Outside it the surface is a mirror. That cone is a picture surface, and it has a distortion no surface in the curved field has — an area scale that runs to zero.
The port that is not there
A flat window into water costs a lens a third of its field. A sphere centred on the entrance pupil costs nothing at all — not nearly nothing, exactly nothing — and six millimetres off centre costs 0.635°.
The horizon is in the window and almost unlit
Snell's window holds the whole sky in a cone, right down to the horizon. Geometry says so and it is true. The surface passes less and less of that light towards the rim, so the last five degrees of sky get a quarter of a degree of the disc at under a third of their brightness. The window's famous edge, which looks like the surface's doing, depends on what is on the bottom, and over a white pool it disappears.
The dome knows its offset in units of itself
A dome port centred on the entrance pupil bends nothing at all, exactly. One that is not bends rays by an amount that depends on the decentring over the radius and on nothing else, so a ten-centimetre dome six millimetres off centre and a twenty-centimetre dome twelve millimetres off centre are the same instrument, bit for bit. The picture carries the ratio, which means it never carries the radius.
A pane gives a product before it gives two numbers
A flat pane of glass displaces every point it is seen through, and the displacement at small angles is the thickness times one minus the reciprocal of the index. So the two numbers arrive multiplied together. Four panes from 6.5 to 13.2 millimetres thick, with indices from 1.35 to 2.1, agree to under two microns over an eight-degree fan and separate by more than a millimetre over sixty — and a fit over the narrow fan returns whichever pair it started near.
One surface, two images
A water surface reflects what is above it and refracts what is below it in the same photograph, from the same plane. The reflected half has a centre of projection to 1 × 10⁻¹⁴ m and every theorem about central projection applies to it; the refracted half misses its own best-fitting point by 28.6 mm and none of it does. And the landscape manual's rule for drawing a reflection turns out to be the epipole placed at infinity, which is why it costs nothing at zero tilt and 11.5 px at twenty-two degrees.
A ball of water has no eye either
A flat interface is not a projection through a centre and misses by ten millimetres. A sphere of water misses by more than that on a ball the size of a plum — 1.3 mm on a fifty-millimetre radius, and the axis crossings spread over 18.6 mm at seven tenths of the aperture. But at two per cent of the radius the same fit returns 24 nanometres, so a ball does have a centre — one at zero aperture and none by the time it is gathering any light.
A point under water has two depths
The apparent depth of a submerged point is not one number even along one line of sight. The rays it sends to an eye pass through two focal lines, and at 60° from the vertical a point 1.50 m down has an image 0.740 m down and another 0.320 m down. Two eyes side by side read the first, a head moving up and down reads the second, and a pair of eyes tilted between them reads neither — their two rays miss each other by as much as 6.39 mm.