What a machine computes

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.

Worth reading first: The divide is postponed, not avoided · A texture does not interpolate on the page.

Jittered frames rebuild a camera’s horizon, saw-tooth and all found that a renderer which moves its sample a fraction of a pixel every frame and averages the frames turns each pixel’s single sample into an average over its area, which is what a camera’s pixel records. Along a walker’s hazy horizon, rolled three degrees, eight Halton frames put the last ground pixels within a hundredth of a camera’s, and the saw-tooth that remained was the camera’s own. Its price was time: jitter shown frame by frame flickered by 0.29, and only a history — a running average of recent frames — turned the flicker into the camera’s picture.

That essay measured a still camera, and it named the weakness it had not tested. A history averages frames that show the same pixel. When the camera rolls, the pixel the history holds is no longer the pixel being drawn, and the history must either follow the motion — reprojection, each stored sample moved to where its ray now falls — or forget faster, which lets the flicker back. The question was how far a moving horizon then sits from a camera’s moving picture, and at what rate of roll a renderer would do better to give up the history and paint four rows of band instead.

A history, two ways of keeping it, and a camera to judge it by

The scene is the earlier essays’: an eye 1.62 metres up, 740 pixels of focal length, a uniform distance fog of five kilometres on a flat ground, a sky of uniform haze. The camera now rolls about its own principal point at a stated rate, starting from three degrees, and is drawn at sixty frames a second. Each frame samples every pixel once, at its centre moved by the next offset of a Halton sequence in bases two and three, and the picture shown is a running blend that keeps nine-tenths of the history and takes a tenth of each new frame, the proportion such renderers commonly use.

The history is kept one of two ways. Left in place, each pixel’s history is the same pixel’s last shown value, as if nothing had moved. Reprojected, it is last frame’s picture read at the point where this pixel’s ray fell a frame earlier. For a roll that point is known exactly — a camera turning about its own centre carries every ray round the principal point, with no depth to guess — so this is reprojection at its best, the motion a renderer can follow without error. What it cannot do is read between pixels without interpolating, and it reads last frame’s picture by blending the four stored pixels round the point.

The judge is a camera’s moving picture: each frame’s scene averaged over every pixel’s area at that frame’s roll. The scene is computed directly from each page point’s ray rather than through the rasteriser’s triangles, and along a horizon rolled three degrees the two agree to 0.0007 of the fog’s range on average — the rasteriser’s horizon is snapped to 1/256 of a pixel, and that is all that separates them.

Rolling at 4° a second, a history reprojected through the roll keeps the horizon's last ground pixels 0.048 from a camera's on average, a history left in place 0.101, and one centred sample a frame 0.025The walker's hazy horizon, 5 km of visibility, the camera rolling at 4° a second from 3° about its principal point, drawn at 60 frames a second; each frame samples every pixel once at its centre moved by the next Halton (2, 3) offset, and the picture shown is a running blend that takes a tenth of each new frame. The fog of each column's ground pixel nearest the horizon in the 48th frame, columns 245 to 445. Pale: a camera's pixel, the scene averaged over its area at that frame's roll. Dotted: one centred sample, no history. Dashed: the history read at the same pixel, as if nothing had moved. Dark: the history read where the pixel's ray fell a frame earlier — exact for a roll, which turns every ray about the camera's own centre. Mean distance from the camera's picture over the pixels within two rows of the horizon, frames 25 to 48: reprojected 0.0480, left in place 0.1008, centred 0.0249. The slider sets the rate of roll.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
Fig. 1 The fog of each column’s ground pixel nearest the horizon, in the 48th frame of a camera rolling at a stated rate: a camera’s pixel, one centred sample, a history left in place, and a history reprojected through the roll. The slider sets the rate of roll.

Rolling at four degrees a second, the reprojected history keeps the pixels within two rows of the horizon 0.048 of the fog’s range from a camera’s picture on average; the history left in place, 0.101; one centred sample a frame with no history at all, 0.025. Still, the same history was 0.0059 from the camera and the centred sample 0.0247. Four degrees a second has taken the history from four times better than no anti-aliasing to twice as bad.

The crossing is at a degree and a half a second

The rate at which the history stops paying is the number the question asked for.

A reprojected history keeps a rolling horizon nearer a camera than one centred sample does only below about one and a half degrees a second: 0.019 against 0.025 at 1°/s, 0.048 against 0.025 at 4°/sThe rolling horizon of the first figure at 0, 0.5, 1, 1.5, 2, 4, 8, 16, 32° a second. Mean distance from a camera's picture over the pixels within two rows of the horizon, frames 25 to 48: one centred sample 0.0247, 0.0251, 0.0249, 0.0249, 0.0250, 0.0249, 0.0250, 0.0252, 0.0263; history, not moved 0.0056, 0.0149, 0.0284, 0.0418, 0.0549, 0.1008, 0.1632, 0.2272, 0.2751; history, reprojected 0.0059, 0.0119, 0.0189, 0.0251, 0.0306, 0.0480, 0.0699, 0.0930, 0.0998. A history left in place averages each pixel with what the pixel showed before the horizon moved through it, and is worse than no history at all from a degree a second. A history reprojected through the roll reads last frame's picture where each ray fell, exactly, but by interpolating between pixels — and an interpolated step is a softened step, softened again every frame the history keeps it, so the error grows with the distance the horizon travels while the history remembers. A single centred sample is never more than a quarter of a pixel's worth of fog from the camera, whatever the roll.00.1000.2000.300how fast the camera rolls, degrees a second (log)mean distance from a camera's picture0141632one centred samplehistory, not movedhistory, reprojecteda tenth of each frame keptclipped at 0.3
Fig. 2 The mean distance from a camera’s picture over the pixels near the horizon, against the rate of roll, for one centred sample, a history left in place and a history reprojected through the roll.

One centred sample a frame stays 0.025 from the camera at every rate from still to thirty-two degrees a second: it is never more than a pixel’s worth of point sampling wrong, and that error does not depend on what the camera did a frame ago. The history left in place is 0.015 at half a degree a second and 0.028 at one — already worse than no history — then 0.055 at two, 0.10 at four, 0.23 at sixteen. The reprojected history is 0.012 at half a degree a second, 0.019 at one, and 0.0251 at one and a half, the centred sample’s own figure; past that it is worse, 0.031 at two, 0.048 at four, 0.093 at sixteen.

A degree and a half a second is slow. A camera held in a hand drifts that much; a car’s camera on an ordinary road rolls by more; a head tilting to look at something rolls at tens of degrees a second. On a horizon, which is the steepest edge in most outdoor pictures, a jittered history earns its keep only on a camera that is very nearly still — or for the part of the picture where nothing steep is moving.

Reprojection smears the step it reads

Reprojection was exact, so the error is not where the history looks. It is how it reads.

Rolling at 16° a second, the reprojected history paints the first full ground row of column 260 at 0.41 where a camera records 0.25, and the last sky row at 0.88 against 1.00: the step is resampled each frame and smeared both waysThe fog down column 260, eighty-five pixels left of the principal point and inside the window the history is kept for, in the 48th frame of a horizon rolling at 16° a second, row by row from six above the horizon to six below. Pale: a camera's pixel; dotted: one centred sample; dark: the history reprojected through the roll. Rows around the horizon, camera / centred / reprojected: -2.9 — 1.00 / 1.00 / 0.98; -1.9 — 1.00 / 1.00 / 0.95; -0.9 — 1.00 / 1.00 / 0.88; 0.1 — 0.86 / 1.00 / 0.72; 1.1 — 0.25 / 0.23 / 0.41; 2.1 — 0.13 / 0.12 / 0.23; 3.1 — 0.08 / 0.08 / 0.13. Reprojection reads last frame's picture where each ray fell, and for a roll that is exact; but the place it reads falls between pixels, and the value there is interpolated from the pixels around it — on the horizon, a blend of sky and ground. Read again next frame, and the frame after, the blend accumulates: the step is a little wider each frame the history keeps it, and wider still the further the horizon has moved, so the ground's fog reaches up into the sky and the sky's haze down into the ground. The centred sample's first full ground row is 0.23, a different error but not a growing one.00.2500.5000.7501-6-4-20246rows from the horizon down column 260, last frame (sky to the left)foga camera's pixelcentred, dottedreprojected historycolumn 260, frame 48, rolling 16°/sdashed: where the horizon runs
Fig. 3 The fog down one column, eighty-five pixels left of the principal point, in the 48th frame of a horizon rolling at 16° a second: a camera’s pixel, one centred sample and the reprojected history, row by row across the horizon.

The point where a pixel’s ray fell a frame earlier is almost never a pixel’s centre, so the history there is interpolated from the four pixels round it. On the horizon those are two of sky and two of ground, and the interpolated value is a blend — a step drawn a little softer than it was. Next frame the softened step is read again, between pixels again, and softened again. The history keeps nine-tenths of what it held, so the softening of a dozen frames is all present at once, and the horizon has moved a long way under it. Rolling at sixteen degrees a second, the row the horizon crosses in this column is shown at 0.72 where a camera records 0.86, the first full row of ground at 0.41 against 0.25, and the last full row of sky at 0.88 against 1.00. The step has been spread both ways — the ground’s fog carried up into the sky and the sky’s haze down into the ground — and it stays spread while the roll continues.

Left in place, the history smears much worse, because it does not follow the horizon at all: it averages each pixel with what that pixel showed before the horizon moved across it. Reprojected, it follows the horizon and smears only by its own interpolation. Both errors grow with how far the horizon moves while the history still remembers, which is the rate of roll times the history’s length.

The pops are the jitter’s below, the edge’s above

The earlier essay measured jitter’s flicker as a mean, and on a moving edge the mean hides the part that shows. A point-sampled edge does not shimmer evenly; it pops — one pixel jumping by most of the fog’s range as the horizon crosses its centre — and the pops are rare and large.

The horizon's pops — its rare large frame-to-frame jumps away from a camera's picture — are the jitter's own below 2° a second (0.045 still) and the centred sample's crossings above it (0.25 at 16°/s); a band moving with the horizon pops 0.009The rolling horizon of the first figure at 0, 0.5, 1, 1.5, 2, 4, 8, 16, 32° a second. The frame-to-frame change of the shown picture's departure from a camera's, exceeded by one pixel-frame in a hundred, over the pixels within two rows of the horizon, frames 25 to 48: one centred sample 0.0000, 0.0144, 0.0269, 0.0410, 0.0548, 0.1028, 0.1834, 0.2464, 0.2410; history, not moved 0.0445, 0.0441, 0.0441, 0.0444, 0.0466, 0.0710, 0.1400, 0.3156, 0.6306; history, reprojected 0.0452, 0.0452, 0.0457, 0.0466, 0.0484, 0.0633, 0.1070, 0.2091, 0.3400; four rows of band, its own camera 0.0000, 0.0003, 0.0007, 0.0010, 0.0013, 0.0027, 0.0052, 0.0093, 0.0110. Still, the history's only jumps are its jitter's, which a blend of a tenth leaves at the size measured: a floor. A centred sample does not jump at all while nothing moves, and jumps by most of the fog's range each time a moving horizon crosses a pixel's centre, more often the faster it rolls. Four rows of band, measured against a camera of the banded scene, barely jump at any rate: the band has nothing steep left to cross a centre.00.2000.4000.600how fast the camera rolls, degrees a second (log)frame-to-frame jump exceeded once in a hundred0141632one centred samplehistory, not movedhistory, reprojectedfour rows of band, its own cameraa tenth of each frame keptthe 99th percentile
Fig. 4 The frame-to-frame jump of each picture’s departure from a camera’s, exceeded once in a hundred pixel-frames, against the rate of roll; and a four-row band measured against a camera of its own banded scene.

The jump exceeded once in a hundred pixel-frames is the measure here, taken of each picture’s departure from a camera’s, so that the horizon’s own motion — which a camera shows too — is set aside. A centred sample does not pop at all on a still camera, and pops 0.014 at half a degree a second, 0.055 at two, 0.10 at four and 0.25 at sixteen: the faster the roll, the more pixel centres the horizon crosses each frame. The reprojected history pops 0.045 on a still camera — that is its jitter, which a blend of a tenth leaves at that size — and barely more until two degrees a second, 0.048; then 0.063 at four and 0.21 at sixteen, as its smear starts to move. Below about two degrees a second the history pops more than no history; above it, less. Its error crosses the other way at a degree and a half. Between one and a half and two degrees a second, then, the history is worse on one count and better on the other, and outside that narrow window it is worse on one count without being better on the other by much.

What a viewer sees at each rate

Put as pictures rather than numbers, the three ways of drawing a rolling horizon look like this. With one centred sample, the horizon is crisp and correct in each frame and crawls as it moves: pixels along it switch between sky and ground one at a time, a little run of pops travelling along the line, faster as the roll quickens. With a history left in place, the horizon leaves a trail: wherever it has just been, the sky’s haze lingers in pixels that are now ground, fading over a dozen frames, a ghost horizon dragging behind the real one. With a reprojected history the ghost follows the horizon instead of trailing it, but the line itself goes soft, a row or so of haze laid along its ground side, and on a still camera the same line is crisp, quiet and right.

None of the three is what a camera shows. A camera’s rolling horizon is the still one’s, carried round: neither crawling nor ghosting nor softened. The earlier essay found that a history reaches that picture on a still camera to within a hundredth. On a rolling one, the nearest of the three to it below a degree and a half a second is the history, and above, the plain centred sample — whose fault is the crawl, and whose crawl is the part of the picture a viewer notices first.

No blend wins both

A renderer’s one free choice is the blend — how much of each new frame the history takes — and the obvious hope is that some blend wins on a moving horizon.

At 4° a second no blend of history beats one centred sample on both counts: keeping a tenth of each frame errs 0.048 and pops 0.063, keeping a third errs 0.025 and pops 0.185, and the centred sample errs 0.025 and pops 0.103The reprojected history taking 5%, 10%, 20%, 35%, 50%, 100% of each new frame, on a horizon rolling at 4° a second and on a still one: each blend as a point, its mean distance from a camera's picture across and its 1-in-100 frame-to-frame jump up. Rolling: 0.05 — 0.0706, 0.054; 0.1 — 0.0480, 0.063; 0.2 — 0.0300, 0.102; 0.35 — 0.0246, 0.185; 0.5 — 0.0283, 0.285; 1 — 0.0598, 0.697. Still: 0.05 — 0.0089, 0.023; 0.1 — 0.0059, 0.045; 0.2 — 0.0100, 0.095; 0.35 — 0.0176, 0.183; 0.5 — 0.0258, 0.285; 1 — 0.0598, 0.701. One centred sample a frame, rolling: 0.0249, 0.103. A longer history quiets the jitter and smears the moving step; a shorter one keeps the step and lets the jitter through; taking the whole new frame is jitter with no history, which pops most of all. The still points show what the history is for. The moving ones show it has no setting at which a moving horizon is drawn both nearer a camera and more quietly than not jittering at all.00.1000.2000.30000.0500.1000.1500.2000.2500.3000.350mean distance from a camera's pictureframe-to-frame jump exceeded once in a hundred0.050.10.20.350.51one centred samplesolid: rolling 4°/s · dashed: stilllabels: the share of each new frame kept
Fig. 5 Each blend of the reprojected history as a point: its distance from a camera’s picture across and its 1-in-100 frame-to-frame jump up, on a horizon rolling at 4° a second and on a still one; and one centred sample, rolling.

At four degrees a second, taking a twentieth of each frame gives an error of 0.071 and pops of 0.054; a tenth, 0.048 and 0.063; a fifth, 0.030 and 0.10; a third, 0.025 and 0.19; a half, 0.028 and 0.29. Taking the whole frame is jitter with no history, 0.060 and 0.70. One centred sample is 0.025 and 0.10. A longer history quiets the jitter and smears the moving step; a shorter one keeps the step and lets the jitter through; and the curve the blends trace passes above and to the right of the centred sample everywhere. There is no blend at which a horizon rolling four degrees a second is drawn both nearer a camera and more quietly than by not jittering at all. On a still camera the same curve passes far below and to the left of it, at a tenth: 0.0059 and 0.045. The history is a tool for pictures that hold still.

What the band buys on a moving horizon

The band’s case was the opposite of the history’s from the start: it changes the scene rather than the sampling, and it does so in every frame alone.

At 4° a second, four rows of band move with the horizon popping 0.003 against 0.103 for a centred sample and 0.063 for a reprojected history — and sit 0.25 from what a camera of the world recordsThe horizon rolling at 4° a second, five ways of drawing it: one centred sample a frame; the reprojected history; four rows of blended haze, centred samples; eight rows; four rows with the reprojected history. First bar of each pair: the mean distance from a camera's picture of the unbanded world, over the pixels within two rows of the horizon. Second: the 1-in-100 frame-to-frame jump of the picture's departure from a camera of the scene it draws — for the banded pictures, a camera of the banded scene, so that the bar measures how quietly the band itself moves. one centred sample: 0.0249, 0.1028; history, reprojected: 0.0480, 0.0633; four rows of band, centred: 0.2507, 0.0027; eight rows of band, centred: 0.2936, 0.0007; four rows of band and history: 0.2357, 0.0176. The band is quiet because it has taken the steep rise out of the last pixels, so a moving edge has little to change as it crosses them; it is a quarter of the fog's range from the world's camera because that is what it painted over. A history on top of the band adds the history's resampling to a scene that did not need it.one centred sample: from the world's camera0.025its pops, against its own scene0.103history, reprojected: from the world's camera0.048its pops, against its own scene0.063four rows of band, centred: from the world's camera0.251its pops, against its own scene0.003eight rows of band, centred: from the world's camera0.294its pops, against its own scene0.001four rows of band and history: from the world's camera0.236its pops, against its own scene0.018rolling 4° a second, 60 frames a secondframes 25 to 48
Fig. 6 Five ways of drawing a horizon rolling at 4° a second: each one’s distance from a camera of the unbanded world, and its pops measured against a camera of the scene it draws.

Four rows of blended haze, sampled at pixel centres with no history, pop 0.0027 at four degrees a second against a camera of the banded scene — a fortieth of the centred sample’s 0.10 and a twentieth of the history’s 0.063 — and 0.0093 at sixteen degrees a second. Eight rows pop 0.0007. The band is quiet in motion for the reason it was quiet still: it has taken the steep rise out of the last pixels, so a moving horizon has little left to change as it crosses their centres. A history on top of it adds its own resampling to a scene that no longer needed it, and pops 0.018.

What the band costs is the same as before and does not move with the roll: four rows of band are 0.25 of the fog’s range from a camera of the world, eight rows 0.29, because that is the ground they paint hazier than its distance. A fog band softens the horizon only by repainting the ground priced that repainting in metres of falsified ground, and nothing about motion changes the price.

So the question’s last part has an answer that is not a rate. If the renderer’s aim is a horizon that moves quietly, the band wins at every rate, including still, and the history never does better than the band on that count. If the aim is a camera’s horizon, the history wins only below a degree and a half a second and loses above it to a single centred sample, which costs nothing. The band is never the camera’s horizon at any rate. The choice is between looking like a camera on a still picture, looking like a camera roughly on a moving one, and looking quiet on both, and the three tools take one each.

What the comparison assumes

The motion is a roll. A roll about the optical axis turns every ray round the principal point and is reprojected exactly. A turn of the head about the vertical moves the horizon sideways instead, and a step forward moves near ground and far ground differently; the second needs depth to reproject and adds the depth buffer’s own error, which the precision a depth buffer has left found least in exactly these rows. The roll is the kindest motion a history can face, so the crossing at a degree and a half is an upper bound for the others.

The history is a plain blend. Renderers usually clamp the history read for each pixel to the range of the current frame’s neighbouring samples, precisely to stop a smeared step from persisting. That is not modelled here, and it is the obvious next question.

The scene is the earlier essays’. A uniform fog on a flat ground meeting a uniform sky, the same five kilometres of visibility; ground and sky meet without a crack is why the page function and the rasterised scene agree to within the vertex snap, and a sky is carried as a direction is why the sky’s value above the horizon is the sky’s own. A horizon of hills, or an atmosphere that thins with height, changes where the rise falls and how steep it is, and with it every number above, but not which tool removes which part.

The camera’s picture is instantaneous. A real camera exposing for a sixtieth of a second smears a horizon rolling at sixteen degrees a second by about half a pixel a hundred pixels from the centre — a motion blur of its own, which would move the judge a little towards the history. At a degree and a half a second the smear is a twentieth of a pixel, and the crossing would barely move.

Where this leaves the horizon

A pixel is not a point is the general argument for averaging over area, and a texture reaches the horizon as a rate found the same three-way division for a texture as the earlier essay found for a fog. Motion adds a fourth consideration that a still picture hides: averaging in time is averaging over what the pixel showed, and a pixel on a moving horizon showed something else. The divide is postponed carried the ground’s attributes so that nothing divided by depth until the pixel; a history is the same trick played over frames, carrying the pixel’s past so that nothing is decided until the average, and like every carried quantity it is only as good as the carrying. On a still horizon it carries exactly. On a rolling one it carries by interpolation, and interpolation is the one thing a steep step cannot survive repeatedly.

Still open: whether clamping the history to its neighbourhood keeps the step without bringing back the pops

The smear persists because nothing stops the history from holding a value the current frame could not have produced: sky, in a pixel whose samples this frame all land on ground. Renderers guard against that by clamping each pixel’s reprojected history to the smallest and largest of the current frame’s samples in the three-by-three pixels around it, so that a history value outside what the neighbourhood now shows is pulled back inside before it is blended.

The measurement that settles what that is worth adds the clamp to the reprojected history here and asks three things: how far the rolling horizon then sits from a camera’s picture at one, four and sixteen degrees a second, and whether the crossing with a centred sample moves from a degree and a half a second towards the rates a hand or a head actually rolls at; whether the clamp, which on the last ground pixel lets through anything between the sky’s one and the deep ground’s fog, is too loose there to stop the smear at all; and what it does to the pops, since a clamp that snaps a history back to the current frame’s range brings back part of the current frame’s jitter.

What links here

Computed from the collection, not written here: the essays that point at this one.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A flat tag is an object no other essay names yet.

Clip spaceHomogeneous coordinatesHorizonProjective mapSamplingSampling grid