Field

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.
x/z, y/z — the pinholeM·p, then divide by wworst disagreement 4.0e-14 px over 8 verticescorrect from 21 cm, at 160 mm wide42° across · near 0.1 m, far 1000 m

The divide is postponed, not avoided

The projection matrix written in the site's own camera coordinates, checked against the pinhole it must reproduce, with the reason the divide waits.

clipped at the near planedivided without clippingdirection cosine -1.0000 — the far end is drawn 2142 px away20 grid segments, 2.4 m of them behind the eyea reversed line is not a large error, it is a different picture

What happens behind the eye

Why clipping happens before the perspective divide, measured as a reversal rather than as a displacement.

00.2500.5000.7501-10123distance from the eye — log₁₀ metresfraction of the buffer's codes used uphalf the codes by 0.20 ma linear map, for comparisonnear 0.1 m, far 1000 mharmonic mean 0.20 m against arithmetic 500 m

The precision a depth buffer has left

What a depth buffer spends its precision on, in closed form, with the harmonic mean checked against a search and a linear map as the control.

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

Two half-pixel conventions in the viewport transform, each read back as a different camera parameter by the site's own recovery.

-0.400-0.200000.2000.4000.6000.8001position across the drawn surfacehow far along the real surface, minus how far along the drawn one(√k−1)/(√k+1) = 0.5195at the page's midpoint, 40.9%depth ratio 10 : 1peak 0.5195 at s = 0.760

A texture does not interpolate on the page

Perspective-correct interpolation derived, with (√k−1)/(√k+1) checked at its own stationary point and a fronto-parallel surface as the control.

the eyenear 0.90 mfar 4.20 mfocal 740 pxprincipal 345, 210

Four numbers and a window

Which entries of a projection matrix are the camera, which are a choice about what is kept, and the single entry that makes the picture a perspective at all.

worst 1e-13 px outcorrect from 17 cm, at 160 mm wide3 × 3 tiles

A tile is an off-centre frustum

Why a tiled render reassembles to the last bit through off-centre frusta, and why rotating the camera per tile does not, with the error measured as a fraction of a tile.

24 kept · 26 clipped · every mark unmovedcorrect from 17 cm, at 160 mm wideclip plane tilted 18°

The near plane can be any plane

An oblique near plane, which changes which points survive without moving any of them, and what it costs the ordering the depth row was for.

01230123the plane moved by a factor of ten to the …depth resolution, relative (powers of ten)near plane, brought infar plane, pushed out1/near − 1/farone term does all the work

One plane is nearly free

What each of a frustum's two planes costs a depth buffer, why the far one is nearly free, and the matrix that has no far plane at all.

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

Driving a curved display with a machine that can only make plane projections, with the sag priced as an angle at the seat, the piece count fitted against the tolerance, and the sense in which no count is ever exact.

00.2500.5000.7501-10-50510across the edge, in pixels of the picturehow much of the background reaches the sensorwhere a pinhole puts the edgethe pupilone depth per samplethe same edge, two ways of blurring it70% apart

One depth per sample is not enough

The depth buffer's single value per sample measured against the integral it is standing in for, with the in-focus control that separates a real disagreement from a sampling artefact.

0.25°0.5°1°2°5°10°20°45°90°0.1110angle of the span from the horizon's direction (log scale)worst texel along a 120 px span (px, log scale)80 px below the horizon160 px below the horizonparallel to the horizon: 0 pxfloor · eye 1.5 m · 60° field

Along a line of constant depth the page is affine

Where screen-space interpolation needs no division at all — the lines of constant depth on a plane, which image parallel to its vanishing line — measured span by span against the closed form, with how fast it fails as a span turns, why a rolled camera's scanlines fail at hundredths of a degree, the exact tolerance 4fH/(L²Z), and why looking up by moving the principal point keeps a wall's columns exact where tipping the camera does not.

6 vertices with w = 0 · each on its vanishing point to 7e-12 pxcorrect from 17 cm, at 160 mm wideedges extended to where their w = 0 vertex lands

A point at infinity is an ordinary vertex

What the projection matrix does with a homogeneous vertex whose last coordinate is zero, measured rather than taken on trust — the vanishing point it lands on, the last coordinate as one over a distance, why sliding the eye cannot move it, the ground it lets reach the horizon, why every finite far plane clips it, and why a direction and its opposite are different vertices.

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

The size at which a shadow map's texels arrive in the eye's picture, measured as the local scale of the map from the lamp's picture through a surface into the eye's and checked against its closed form — for a lamp beside the eye, overhead and facing back, drawn on the floor, swept through the surface's orientation, and priced as the map size each lamp needs.

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

What it costs to walk a banked floor along its own constant-depth lines instead of along the page's rows, once the tilted spans have to be rasterised onto square pixels.

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

How far one shadow map warped for the eye can go toward texels no larger than a pixel, what the best warp is for a lamp facing the eye, why one texel per pixel is a hard bound, and what no warp of the lamp's picture can reach.

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

How a texture coordinate is carried to a vertex at infinity — as a rate with a weight of zero — and what that buys and costs, measured down one column of a ground triangle: exact to the horizon in double precision and to a part in ten million in single, reverse perspective when the corner is given a value, a broken fan when the clipper drops the weight, and a pixel's reach along the ground growing as one over the square of its distance below the horizon.

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

What a full projective warp of a shadow map buys over re-spacing its rows, for a floor seen by an eye and lit by lamps in three places — computed texel by texel and checked by carrying the warped map's texels back into the eye's picture: the texels each way of spending a map needs, the texels a row warp wastes that a full warp does not, the warped map's texel grid landing as equal squares in the eye's picture, the three lamps, and the second surface on one lamp ray that no single map can serve.

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

What a renderer should carry across a triangle whose every vertex is a direction — measured on sky triangles drawn through a matrix with no far plane: the interpolated direction against each pixel's ray in double and single precision, the length it carries and discards, the error of looking the sky up by interpolated angles against the triangle's span, and what happens where azimuth wraps.

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

Ground and sky meet at the horizon without a crack

What happens where a ground of rate triangles meets a sky of direction triangles along the horizon, rasterised with fixed-point vertex positions and the top-left rule — measured across rolls and snappings: pixels lost or doubled, centres the ground claims beyond the true horizon, how large its texture coordinate grows near the edge and whether single precision can hold it, which triangle owns a centre exactly on the edge, and the crack a ground stopped at a far plane leaves.

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

Whether a quantity that ought to run continuously from a rasterised ground into its sky does: the elevation of each pixel's ray read from the ground's rate and weight and from the sky's direction, measured across the shared edge at four snappings and in single precision; and fog by distance, whose step at the horizon is set by how far away the last ground row is, against visibility, eye height and the pixel's own area.

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

Where a pixel's index goes when a picture is resized, measured. Half a pixel of convention becomes a shift of (s − 1)/2 at every scale, approaching one half down a pyramid and doubling in the original's units, with vanishing points agreeing with the true map to a billionth of a pixel.

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

Whether an elevation haze and a distance fog can be joined across a rasterised horizon without a visible step: the sky's haze carried a band of rows into the ground by a smoothstep, the largest row-to-row change it leaves against the band's width and the visibility, how far out the band then misstates the ground's fog, what an eye's height changes and what it does not, and what a band does to the saw-tooth along a rolled horizon.

-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

Viewport rounding measured over 15,408 windows, six shapes and eight display scales. The focal lengths differ by up to 3.3 parts in a thousand, the edge displacement is bounded near 0.69 px at any size, and no picture can read it.

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

Whether jittering a renderer's sample position and averaging frames quiets the shimmer along a hazy horizon without the fog band that repaints the ground: the last ground pixel's fog along a rolled horizon from one centred sample, from jittered frames averaged, from the pixel's whole area and from a four-row band; how fast Halton and random offsets converge on the area; what the saw-tooth and the step look like at every visibility; and what jitter shown frame by frame does to a still picture.

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

Whether a renderer's jittered history keeps a camera's horizon when the camera rolls: the last ground pixels' fog against a camera's moving picture for one centred sample, a history left in place and a history reprojected through the roll, at rolls from half a degree to thirty-two degrees a second; the rare large frame-to-frame jumps each produces; how the history's blend trades one against the other; why reprojection smears the step it reads; and what a fog band costs and buys on a moving horizon.

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

Whether clamping a reprojected history to its neighbourhood keeps a rolling horizon nearer a camera's picture: the error and the 1-in-100 frame-to-frame jump against the rate of roll for a min–max clamp and a mean-and-spread clip, where the clamp's window is loose and where it is tight, what tightening the clip does on a rolling horizon and on a still one, and why the rows a clamp cannot reach are the rows the smear is on.

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

A renderer's camera carried through a compositor's scale and a screenshot's readback, over 9,630 windows from 320 to 2,560 px wide in six shapes at device scales 1.25 to 2.5. Drawing straight into a fractional buffer, or drawing at the next whole-number scale and reducing by the true map, gives the same worst edge displacement, 0.708 px, inside the one-rounding bound everywhere; a screenshot read back at the window's logical size shows none at all. A naive reduction reaches 0.915 px and breaks the bound in 586 windows. A naive chain to a logical screenshot leaves the centre (1 - 1/k)/2 px off, 0.25 for a whole-number scale of 2 and 0.333 for 3, breaking the bound in 642 windows.

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 1280×720 window on displays at device scales from 1.25 to 3, screenshotted through a compositor by the true map and cropped by 200×150 rectangles given in logical pixels, at every position. Rounding each edge, or the origin and size separately, moves the camera's principal point in the cropped picture by at most 0.5 px each way, 0.707 px together, cycling with the fraction of the scale times the edge's position; halves rounded up leave a mean of −0.25 px at 1.5. Reading the edge as a pixel's centre adds (d − 1)/2, reaching 1.41 px at 2.5 and a whole pixel at 2 and 3; the enclosing box floors it, 1.06 px at 1.75. Saved at the crop's logical size, each-edge rounding stays under 0.57 px at the corners. A cropped picture equals an off-centre camera's to 10⁻¹³ px.

window, 1280 × 720 logical, at 1.5117 × 73 pxfx 346.3 pxfy 348.4 pxcrop 211 × 131 → 117 wideheight 72.57 → 73

A thumbnail gives its camera a pixel it cannot see

A 1280 × 720 window at a device scale of 1.5, crops of 61 × 47 to 900 × 560 logical pixels landed on the panel by rounding each edge, then resized by the true map to every target width from 64 to 800 px with the height rounded or floored. Measured: the two focal lengths' relative disagreement against 1/(2h), over 10,659 crop sizes at 320 px; the disagreement in target pixels against half a pixel times fx/h; the largest error at the picture's corners from the resize alone (under 0.494 px) and with the crop's own rounding carried at the resize's scale (5.7 px for a narrow crop enlarged 8.7 times); and the spread with which a box and a square read the pixel's squeeze in pictures 160 to 690 px wide, at 0.5 and 0.1 px.

316 × 196690 × 428straight to 690fy/fx − 1 = 0.01%316 × 196117 × 73690 × 431via a 117 px thumbnailfy/fx − 1 = 0.71%316 × 19625 × 16690 × 442via a 25 px picturefy/fx − 1 = 3.28%boxes at 0.2 of their pixelseach tool rounds the height it was handed

A chain of resizes remembers its smallest picture

The 211 × 131 logical crop at a device scale of 1.5, 316 × 196 on the panel, resized through chains of tools that each round the height from their input, by exact integer arithmetic. Measured: three chains to 690 px drawn to scale; the final squeeze through every intermediate width from 24 to 690 px against the sum of the two roundings (filled to 98%) and the last alone (±0.117%); the final height's error in whole pixels (up to 14.0 px); the squeeze a smallest picture can leave against the spread with which a box and a square read it at that size (never under 2.0 times); root-mean-square squeeze over 3,000 chains of one to six resizes (0.120% to 0.289%, against √Σ1/(12h²)), floored chains (mean −0.176% to −1.078%), and 4,000 chains of a figure, a device ratio and a card (14.3% past the last step's rounding, by up to 2.71 times).

00.2500.5000.7501-20-1001020pixel down the patch's middle columnintensityexactsnapped spansturned framebank 20°, 0.3 cycles a texelrms: spans 0.120, frame 0.126

A banked floor drawn in its own frame trades place for sharpness

A floor banked 1° to 45° about the line of sight, 120 px below its horizon, one texel a pixel at the middle of an 81 by 81 px patch, textured with stripes of 0.01 to 0.45 cycles a texel or a checker. Three page images: exact, every pixel's attribute computed at the pixel; snapped spans, each pixel given the attribute at the foot of its perpendicular on the nearest of a family of constant-depth lines a pixel apart; and the own frame, exact samples on a lattice turned to the constant-depth lines and resampled bilinearly at each pixel. Measured: a column of the patch in all three; the rms intensity error of each against the exact image against the stripes' frequency, and the frequency where they cross; both against the bank; on a checker; and at spacings of a half and a quarter of a pixel, against the samples each draws.

All essays