Concept

Sampling grid — where it appears

The array of samples a picture is stored on, whose density per unit solid angle is the reciprocal of the surface's area scale. It is why an equal-area surface and an equal-angle one store a scene at very different densities, and why a count made on one is not a count made on the other.

Named by 29 essays across 6 fields — each of them below, with the objects they name alongside it.

one pixel is an areacentrescornersprincipal point moves0.707 pxfocal length changes by4.5e-13 pxan edge-versus-centre viewport1.303 pxa half-pixel convention is a principal-point error; an off-by-one viewport is a focal-length error8 vertices, all shifted by the same 0.7071 pxspread across marks 0.0e+0 px

A pixel is not a point

Where the sample sits inside a pixel is a convention, and getting it wrong shifts every mark by half a pixel in each axis. What that costs can be measured by recovering the camera from the picture — the answer is a principal point exactly 0.707 px from the truth with the focal length untouched, and the other half-pixel mistake does precisely the reverse.

pipeline · Viewport
leftfrontrightbackupdownacross the left/front seam: 1.80°, with each side straight to 7e-16corner area ×5.196anisotropy √3 = 1.7321 there

Six flat pictures of everything

There is one way to photograph the whole sphere and keep every straight line straight, and it is to stop using one surface. Six flat pictures at ninety degrees cover everything, each of them a perfect pinhole, and the price is paid entirely at the seams — where a straight line does not bend but kinks, by an angle that reaches 45 degrees and is exactly zero for the lines lying in the seam's own plane.

curved · Cubemap
the seat3 chords against the arccurved monitor, 3 flat pieces6.80 mm of sag · 5.50 px at the seat

A curved screen is eight flat ones

A projection matrix is a plane and nothing else, so a curved display cannot be rendered — it has to be driven as several planes and assembled. The gap between chord and arc is the whole error, it goes as the square of the angle each piece spans, and the piece count therefore goes as the inverse root of the tolerance — three for eight pixels, eight for one, fifteen for a quarter.

pipeline · Tiling
11.201.401.6001234how far along the sofa the seat is (m)largest pixel over smallest, across the picturecurvedflat, same widthcurved television against a flat panel of the same widththe curved worst case is at 1.5 m, not at the end

The evenness a curve buys

A curved screen is sold on evenness, and evenness turns out to be three quantities that disagree. On pixel pitch the curve wins from every seat; on the angle the glass is turned through it wins until three and a half metres along the sofa; on the plain distance from eye to glass — the reading the argument is usually made in — it gives up before half a metre.

screen · Screenfov
5710142028400.31310distance along the floor from below the eye (m, log scale)pixels one shadow-map texel spans on screen (log scale)1 pxlamp beside the eyelamp 30 m overheadlamp 40 m ahead, facing backmeasured against the closed form: 4e-91024-texel map · eye 1.7 m · 50° field

A shadow map's texels land by two distances and two cosines

A renderer finds its shadows by taking a second picture from the lamp and storing a depth in every texel. Each texel reaches the screen through the surface it falls on, and how many pixels it covers there is a closed form — two focal lengths, two distances and two cosines. From a lamp beside the eye every texel lands at 0.79 px; from a lamp 40 m ahead facing back, the same map lands texels of 8.69 px on the floor 5 m out.

pipeline · Shadowmap
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.

pipeline · Shadowmap
1 holetilt 0°closes at 71.3°

A hole is not preserved

The shadow of a connected object is connected — always, at every lamp position, and for a reason with no geometry in it. A hole survives in neither direction: a ring's shadow closes up at a computable tilt, and an object with no hole in it casts a shadow that has one.

light · Shadowtopology
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.

pipeline · Shadowmap
near edge: 0.98far edge: 0.76turned 15°, corrected to 16:9, source at panel resolutiondark: more panel per source pixel

Keystone correction spends the panel unevenly

Turn a projector fifteen degrees and keystone correction throws away 18 per cent of its panel — the number a specification quotes. It is the smaller half of the price. What remains is spread unevenly: the near edge of the corrected picture gets a panel pixel for every source pixel, the far edge three-quarters of one, so the far edge carries 58 per cent of the source's detail. A tipped projector keeps more than a turned one, and a lens shift that places the same picture loses nothing at all.

screen · Keystone
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.

pipeline · Homogeneous
near edgefar edgeturned 15°, every 96th panel column and row82.2% of a frame

An even spend of the panel is an uneven picture

A keystone correction that spends the panel evenly exists: render the picture straight into the panel pixels that reach the corrected rectangle, one sample each. At fifteen degrees that is 82.2 per cent of a frame's samples, and on the wall it delivers exactly what a full frame does — 0.99 of the source's detail at the near edge, 0.76 at the far — because the panel, not the source, was setting the detail everywhere. It removes no unevenness. On fewer samples it makes the picture worse where it was worst; the even picture is a uniform source of 57.6 per cent of a frame.

screen · Keystone
00.2500.5000.75012345how high the eye is (m)share of the object, and share of the design that landsof the object's surfaceof the design that landsa corridor with a doorway, 7 facesbest surface share 100% at 2.5 m

The eye that reaches the most

A higher eye buys the faces occlusion was hiding and loses design off the far end of the object, so "the best eye" is not a question with an answer until somebody says which of the two they are paying for. On three objects the answer is as high as possible; on a corridor with a doorway in it the two quantities cross and the best height is two and a bit metres.

viewing · Anamorphreach
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.

pipeline · Homogeneous
020406080-5000500across the corrected picture, mm from its centre (the projector's side to the left)detail per degree for the seat worst placed there (px/°)the source laid evenlythe panel's own densitythe even picturelaid for the audienceturned 15°, 57% of a frame eachpx per degree of view

The even picture is fair to a centred room, and only to it

Judged by detail per degree of each seat's view, the corrected picture that is even on the wall is already the fairest possible for an audience centred on it: a layout drawn for that audience gains its worst seat nothing. For an audience on the far side it is also the best, because the far edge is where the panel is coarsest and the even picture already spends all of it there. Only an audience on the projector's side can be served better — thirty per cent better at a fifteen-degree turn — by putting the samples on the near edge, where the panel has them to give.

screen · Keystone
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.

pipeline · Viewport
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.

pipeline · Homogeneous
406080-3-2-10123where the viewer is, metres across from the picture's centre (projector's side −)detail per degree at the viewer's worst place (px/°)about what an eye resolves, 60 px/°the even picturelaid once for the walkfollowing, no lagfollowing 0.5 s lateturned 15°, walking 3 m from the wall at 1 m/smean over the walk: even 47.4, late 51.8 px/°

A walking viewer gains from a following layout only on the projector's side

Re-lay a turned projector's corrected picture frame by frame for one viewer walking across the room and they gain up to thirty-one per cent of detail per degree — on the projector's side of the picture, where the panel has samples to spare, and nowhere past eighty centimetres beyond its centre. A layout drawn once for the whole walk gains nothing at all. Half a second late, the following layout keeps four-fifths of the gain and at the worst moment serves the viewer six per cent worse than the even picture; four seconds late it is worse on average. And whatever it gives the walker it takes from a seated room: up to twenty-nine per cent of the worst seat's detail.

screen · Keystone
-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.

pipeline · Viewport
00.2500.5000.75010.2500.5000.75011.25the largest stretch a painter will accept, log₁₀share of the design that is inside ita flat floora cornera cluster of blocksa seating rakean ascending flighteye at 1.70 m, 2.4 m in front of the picturethe cap a painter will accept

The stretch decides the band

A design band chosen by geometry — the rays that meet the object — includes rays that graze along it, and a grazing ray lands two design points twenty times further apart than the design says. Cap the stretch at four and a bare floor keeps 55 per cent of its design, a corner 80, and the top of a descending flight all of it.

viewing · Anamorphmap
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.

pipeline · Homogeneous
010203002468seconds into the walk (both from the projector's side to the far side, a metre a second)gain at the walker's worst place over the even picture, %leader, followed aloneleader, sharingtrailer, followed alonetrailer, sharinga projector turned 15°, walkers 3 m from the wall1 m apart

Two walkers share a layout drawn for the worse of them

A projector turned to its wall can re-lay its corrected picture for one walking viewer and give them up to thirty per cent more detail per degree on the projector's side. For two, it draws the layout that serves the worse-served best. Walking the same way a metre apart, the one nearer the picture's centre keeps 99 per cent of its own gain and the other 77, falling to 44 at four metres apart. Crossing, they keep two per cent. A viewer on the far side vetoes the other only while it is the worse-served — and at different depths the shared layout takes from the walker it serves better, leaving them below the even picture.

screen · Keystone
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.

pipeline · Homogeneous
-0.50000.5001-50510the worse-served walker's mean gain over the even picture, %the smaller share either walker keeps of their own gainserve the worse-servedmost detail in allmost of both shareslargest smaller sharedashed: the even picture's level and no share kept2 m and 5 m from the wall

A rule that weighs two walkers spares the one serving the worse would starve

A projector following two walkers can share one layout between them by serving whichever is worse-served. Weighed instead — the most detail in all, the most of both walkers' shares of their own best, or the largest of the smaller share — the shared layout gives up a little of the worse walker's gain and changes who pays for it. Walking two and five metres from the wall, serving the worse gives the near walker 11.7 per cent over the even picture and takes the far one below the even picture, out of resolvable detail in a fifth of the frames; keeping the smaller share largest gives the near walker 6.8 per cent and leaves both at least 61 per cent of their own best, never below what an eye resolves. The most detail in all is the worst rule of the four: crossing, it serves the worse walker 9 per cent below the even picture.

screen · Keystone
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.

pipeline · Homogeneous
25507510002468seconds into the walk, a metre a seconddetail where each walker looks, px a degreenear walker, worse-served rulefar walker, worse-served rulenear walker, smaller-share rulefar walker, smaller-share rulefar walker, even picturescored straight in front of each walker2 m and 5 m from the wall

A walker charged at its worst place gains where it looks

A projector sharing one layout between two walkers, drawn for the worse-served of them, took the further walker below the even picture at its worst place — the picture's far edge, which it sees at a slant from five metres. Scored instead at the part of the picture straight in front of each walker, the same layout gives that walker 10 per cent more than the even picture, not 6 per cent less: the samples were taken from where it was not looking. The four rules for sharing then nearly agree, 11 to 12 per cent for the worse-served walker. Two things bring the charge back. A walker looking 30 to 40 degrees ahead along its walk looks at the edge the layout starved. And a walker looking at the picture's middle is served alike by every layout, because every layout the projector can afford takes its samples from there.

screen · Keystone
direct0.708 pxdirect, logical shot0.000 pxcomposited0.708 pxcomposited, naive0.915 pxcomposited, logical shot0.000 pxnaive throughout, logical shot0.471 pxworst over every windowpale: breaks the bound

A display's scales cancel, if they are true maps

Between a renderer's buffer and a screenshot there may be two more resamples: a compositor reducing a whole-number scale to the panel, and a screenshot read back at the window's size. Each rounds to whole pixels, and under the true map the roundings telescope: only the last size and the renderer's assumed aspect matter, so the one-rounding bound survives, and a screenshot at the window's size shows the square camera exactly. A naive step breaks the bound in six per cent of windows and moves every centre.

pipeline · Viewport
the camera's principal point1280×720 logical, device scale 1.5crop rounding: 0.50, 0.00 px

A crop moves the frame and not the camera

A crop of a screenshot scales nothing. It moves the frame's corner and leaves the renderer's principal point where it was, so the cropped picture is exactly the picture of an off-centre camera and nothing in it can say otherwise. What the crop adds is the rounding of its edges to whole screen pixels, which moves the principal point by at most half a pixel each way, in a pattern that repeats with the crop's position and never grows. Converting the crop's corner with the map that is right for a pixel's centre adds half the scale's excess on top, a whole pixel on a display at 2 or 3.

pipeline · Viewport
correct from 14 cm, at 160 mm wide12×12 cells · worst 1.57 px

Copying square by square

The taught grid workflow sets a pavement's cell corners out exactly and then fills each cell by eye, and the corners are right while the fill is not — 3.30 px on a picture 690 across at eight cells, falling as the square of the cell. On a wall square to the camera the same fill reads 3e-13 px, which is why the method feels reliable.

construction · Gridcopy
lamp, 1.36 mcorrect from 20 cm, at 160 mm wide2 pieces · 1.6 m back

Where a shadow splits in two

A gantry's shadow is two pieces at a lamp height of 1.36 m, and the crossing to one piece happens at a tangency running the whole length of the beam rather than at a point — the same plane that meets a ball at an aspect of 1.00 to 1 meets the beam at 1736 to 1, and a grid finds the true crossing height to a fitted exponent of 1.00 as it is refined. A ring tipped 70° keeps its hole for a completely unrelated reason, closing only at 71.34°, which is the warning that a shadow's topology changes at a tangency names two different accidents rather than one.

light · Shadowtopology

Named alongside it

The objects these essays reach for when they reach for this one.

Projective mapResolutionPicture surfaceForeshorteningKeystoneViewing positionCamera matrixClip spaceHomogeneous coordinatesHomographyHorizonQuantisation

All concepts