The collection

Every essay — page 17

Page 17 of 25, continuing through the fields in the same order.

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.

the constant-depth direction, 20.0°a floor banked 20°, 40 pixels of the walkworst 0.60 px off the line

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.

5 figures
the whole picture, one density9530²the frustum fitted to the floor7322²the best projective warp of its rows897²the best warp of its rows, any shape840²one texel per pixel of the floor385²the same, with a wall at every point502²facing lamp, floor to 60 m, no texel over a pixel · log scale÷113 by one warp

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.

5 figures
rate vertices at w = 0 · texture exact to 6e-10 checks at half a pixel from the horizoncorrect from 17 cm, at 160 mm wideone-metre checks, no far plane

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.

5 figures
the frustum fitted to the floor53.61 millionits rows re-spaced, one parameter805 thousandits rows re-spaced, any shape706 thousanda true perspective, one parameter752 thousanda full projective warp154 thousandone texel per pixel of the floor148 thousandlamp 40 m ahead, facing back, floor to 60 m, no texel over a pixel · log scale÷4.6 over any row warp

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.

5 figures
three vertices at w = 0 · directions exact to 3e-14° · angles off by 7.7°correct from 6 cm, at 160 mm wideno far plane, no point in the triangle

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.

6 figures
camera rolled 11.3°, positions snapped to 1/256 px0 lost · 0 doubled

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.

6 figures
00.2500.5000.7501-20246rows below the horizon (negative: sky)fog by distance, 1 − e^(−D/L)visibility 300 mvisibility 1.2 kmvisibility 5 kmvisibility 20 kmeye 1.62 m up, f = 740 pxthe last row holds the rest

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.

5 figures
the original gridthe grid at 0.5the dots are where each pixel's index standsshift -0.250 new px

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.

6 figures
00.2500.5000.7501024681012rows below the horizonfogdistance fogblended over 2 rowsvisibility 10 km, eye 1.62 mlargest row step 0.529

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.

5 figures
-0.50000.5001e+32e+33e+3the buffer's width (device pixels)displacement at the frame's edge (px)16:9 windows at 1.25×bound ±0.694 px

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.

6 figures
00.2500.5000.7501100150200250column along the horizon (rolled 3°)fog of the last ground pixela camera: the pixel's areaone sample at the centre8 jittered frames, averagedfour rows of band, area5 km of visibility, rolled 3°8 frames: 0.009 from the camera

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.

6 figures
00.2500.5000.7501250300350400column along the horizon (the principal point at 345)fog of the last ground pixel, last framea camera: the pixel's areaone centred samplehistory, not movedhistory, reprojectedrolling 4° a second, 60 frames a secondframe 48, a tenth of each frame kept

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.

6 figures
00.2500.5000.7501250300350400column along the horizon (the principal point at 345)fog of the last ground pixel, last framea camera: the pixel's areaone centred samplehistory, reprojectedhistory, clampedrolling 4° a second, 60 frames a secondframe 48, clamped to the 3 × 3 range

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.

5 figures

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.

water, n = 1.333eyetruly 1.50 m downappears 0.818 m downh/n would be 1.125 mno single viewpoint — the rays miss by 17.1° of bend at the surfaceapparent depth 54.5% of the true one, not 75.0%

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.

5 figures
the water surfacethe pinholethe rays miss by 9.9 mmno single viewpoint — the rays miss by 9.9 mmdry control: 0e+0 m

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.

5 figures
no single viewpoint — the rays miss by 4.5 px, depth-dependentf recovered from it: 396.88 px

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.

6 figures
15°30°45°60°85°the rim: 48.61° from straight upbeyond it: the bottom, reflected45° of sky0.469460° of sky0.370275° of sky0.211485° of sky0.0738area scalen = 1.333, so the rim is at asin(1/n) = 48.61°area scale 0.563 at the centre, 0.0738 at 85°

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.

5 figures
00.50011.50205101520the dome's centre, off the entrance pupil (mm)worst departure from the pinhole it would be in air (degrees)centred: exactly zero6 mm → 0.635°a 100 mm dome in acrylic, n = 1.4910.106° per mm of centring error

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°.

5 figures
the critical angle, 48.61°00.2500.5000.75010204060angle off the zenith (°)brightness, as the disc draws itfrom the zenith out to 60°bottom of albedo 0.3

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.

7 figures
00.2000.4000.6000.800204060how far off the axis the ray leaves the pinhole (°)how far the dome bends it (°)10 cm dome20 cm domeboth at offset/radius = 0.060identical to 1e-16°

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.

8 figures
00.2000.4002468how far off the perpendicular the sightline is (°)how far the pane moves the point (mm)13.2 mm, n = 1.3510.0 mm, n = 1.528.0 mm, n = 1.756.5 mm, n = 2.1t(1 − 1/n) = 3.421 mm for all four1.8 µm apart over 8°

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.

9 figures
correct from 15 cm, at 160 mm widereflecting and refracting · 6.0e-12 px

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.

8 figures
parallel in, no common point out18.6 mm of spread

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.

8 figures
water, n = 1.333eyethe point, 1.50 m downsagittal: 0.740 mtangential: 0.320 mno single viewpoint — the rays miss by 0.840 mbetween the pencil's two images

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.

6 figures