Homogeneous — the series
-
The divide is postponed, not avoided
A renderer does not divide by depth. It multiplies by a four-by-four matrix that carries the depth in a fourth coordinate and divides later, and the postponement is not an optimisation — it is what makes clipping and texture interpolation possible at all. The matrix and this site's pinhole put every point on the same pixel to five parts in a hundred trillion.
-
A point at infinity is an ordinary vertex
Give a vertex a zero in its fourth slot and it stops being a point and becomes a direction — and the projection matrix draws it anyway, through the same multiply and the same divide, on that direction's vanishing point to seven trillionths of a pixel. Slide the eye ten metres and it does not move. Two of them bound a ground that reaches the horizon, where a ground drawn to ten kilometres stops a fifth of a pixel short.
-
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.
-
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.
-
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.
-
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.