← Back to guides
Guides · Anthology

Why Is It Like This?

The original sins of computer graphics.

October 22, 2026 · ~14 min read · 16 interactive widgets

Every industry has its haunted houses: the defaults nobody set, the numbers everyone uses, the conventions that made sense once and now just live here. Here’s the tour.

[The pattern: every number here was a reasonable fix for a real problem. Then the problem went away and the number didn’t. Each entry stands alone and has its own link.]

The Utah teapot

[1975, University of Utah. Martin Newell sketched his Melitta teapot on graph paper and entered the Bézier control points by hand. It became the test object: curved everywhere, concave and convex, saddle points, a handle with a hole, a spout that occludes the body. And no bottom, which is why so many renders never show one.]

[The teapot you know is about 25% shorter than the real one (the real one is roughly 4:3 taller). The story everyone tells: Jim Blinn squashed the data to cancel his framebuffer’s non-square pixels, then passed the squashed file around. What Blinn says: he scaled it during a demo to show they could, everyone liked it better, and that’s the file that got saved. Newell: “Everybody, including me, liked the teapot squished.” The myth survives because it fits suspiciously well: Alvy Ray Smith’s memo gives a pixel spacing ratio of 1.25 for that 512×480 framebuffer on a 4:3 monitor.]

The teapot and the framebuffer

1.00 : 1
This is the real teapot, at its real height. The renderer assumes square pixels; the slider squashes the pixels it lands on. At the Utah framebuffer's 1.25:1 the teapot looks a fifth shorter than it is, close to the squat teapot in the file (a quarter shorter), seen on a square-pixel screen. The blue outline is the original; the orange one is the file, undistorted. Drag to turn it; the grid's hash marks are one unit of Newell's data.

Y-up vs Z-up

[Max is Z-up because CAD and architecture are: Z is elevation off the plan. Maya, Houdini, Unity and glTF are Y-up because screen space was. Then handedness on top. Every FBX export you’ve ever rotated by 90°.]

Which way is up
made in
opened in

The file holds three numbers per point and no opinion about what they mean. 3ds Max, like the CAD and architecture tools it grew up next to, calls height Z. Maya, like the screen it draws on, calls height Y. Some engines go a step further and flip handedness, so one axis points the other way. Every exporter has an axis-conversion checkbox, and every pipeline has at least one asset that went through with it unticked.

0x5f3759df: fast inverse square root

[Every lit pixel in a 3D game needs a surface direction of length exactly 1, and getting there means dividing by a square root: 1/√x. In the late ’90s both the square root and the divide were slow. The Quake III Arena source (id Software, 1999) did it with no square root and no divide: read the float’s bits as an integer, shift them right one place, subtract the result from a magic number, read it back as a float, and polish it with one step of Newton’s method. The comments next to it, “evil floating point bit level hacking” and “what the f***?”, became famous when id released the code in 2005.]

[Why it works: a float is stored as a power of two and a fraction inside it, so its bits, read as one integer, are already a rough logarithm of the number (the How numbers are stored widget shows the integer climbing one step at a time). In log land a square root is halving and 1/x is negating. The shift halves. The subtraction negates and puts the exponent offset back. The magic number is mostly that offset, with a small tuned correction.]

[Whodunit: not Carmack, who has said it wasn’t his, and not DOOM, which ran on integer fixed-point math and barely touched floats. The code traces back through Gary Tarolli (SGI, later 3dfx) to Greg Walsh at Ardent Computer in the late 1980s, and the idea of guessing a square root from a float’s bits is older still. 0x5f3759df isn’t even the best constant: Chris Lomont found slightly better ones in 2003.]

[Where it went: nowhere, and everywhere. Nobody ships this code any more. Intel added an approximate reciprocal square root instruction to SSE (rsqrtss, in the Pentium III) the same year Quake III came out, and every GPU has one. They are not this trick in silicon; they use lookup tables. But they are the same bargain: a fast answer good to a few digits, sharpened with a Newton step only if you need it. Normalizing vectors for shading, and for rays in a raytracer, still runs on that bargain.]

Five lines from Quake III
y  = number;
i  = * ( long * ) &y;                // evil floating point bit level hacking
i  = 0x5f3759df - ( i >> 1 );         // what the f***?
y  = * ( float * ) &i;
y  = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
signexponentmantissaread as one integer
x (log scale) →
true 1/√x
this step's answer
error
Pick any x and step through the five lines that made Quake III's lighting cheap. The trick is step 2: a float's bits, read as an integer, are already a rough logarithm of the number. Logs turn square roots into halving and division into subtraction, so a shift and a subtract do the work of a square root and a divide. One round of Newton's method cleans up the rest. Every number here is a real 32-bit float, computed the same way the C code does it.

23.976 and 2:3 pulldown

[Film is 24. 24 frames into 60 fields goes A A B B B, the 2:3 pulldown. Into 59.94 fields it only fits if the film runs 0.1% slow: 24000/1001 = 23.976. “23.98” is the rounded label for the same number.]

24 into 60
A is on screen for
B is on screen for
one hour of film (86,400 frames) takes
film speed that keeps step
Two film frames fill five fields, so the frames alternate between two fields and three on screen. That alternation is the slight stutter on a slow pan in anything shot on film and watched on NTSC. At 59.94 the five fields take a thousandth longer than two film frames, so the film is slowed to match, and the sound with it.

Interlacing and field order

[The problem: 30 full frames a second flickers badly on a CRT. The fix: send alternate lines in each field, 60 refreshes a second for the bandwidth of 30 frames. The bonus nobody planned: a video camera samples each field at a different instant, so 60i is 60 moments in time a second.]

[Where it bites: weave two fields on a progressive screen and anything moving combs. Get the field order backwards and motion plays 2, 1, 4, 3: one step back for every two forward. Do that to 2:3 pulldown and you get both at once.]

Field order lab
CRT field 0
ground truth
upper lines lower lines ground truth
0.25 real time
A video camera records every field at a new moment, which is why old sport looks so smooth on a CRT. A progressive screen that weaves the two fields of a frame together shows both moments at once, and anything moving combs. Swap the field order and each pair plays backwards: the bar steps forward two and back one, sixty times a second. Run film through 2:3 pulldown with the order swapped and you get that judder on top of the pulldown's own stutter. The picture on the right is the ground truth: whole frames at the source's own rate, on the same clock.

The hum bar: 60 Hz vs 50 Hz

[Black-and-white NTSC (1941) ran exactly 60 fields a second because the wall did. Poorly filtered power supplies put a ripple on the picture, a hum bar. Lock the field rate to the mains and the bar sits still where nobody notices; don’t, and it rolls. Europe’s grid is 50 Hz, so PAL and SECAM are 50 fields, 25 frames, and never needed a fudge.]

[Exceptions worth one line each: Japan runs a 50 Hz east and a 60 Hz west and uses NTSC everywhere; Brazil’s PAL-M is PAL color at 60 Hz. Your HDMI menu still offers 59.94 Hz.]

Mains and the raster
field 0
where in the mains cycle each recent field began
60.00 Hz

The dark band is the wall socket showing through a power supply that can't quite smooth it out. Each scanline is drawn a little later than the one above it, so the band lands wherever the mains happens to be when the beam gets there. Lock the field rate to the mains and the band never moves, which is the next best thing to not having one. At 59.94 on a 60 Hz grid it takes about 17 seconds to drift past. Try 60 fields on a 50 Hz grid, then slow it down to see what you were looking at.

29.97 fps

[1953. Color had to fit into the same 6 MHz channel and still play on every black-and-white set already sold. The color subcarrier sits at 455/2 times the line rate, so its energy falls between the teeth of the luma comb. But it also beat against the 4.5 MHz sound carrier, at about 920 kHz, and that beat needed to fall between the teeth too. Moving the sound carrier would have broken existing TVs. So they moved everything else: line rate = 4.5 MHz / 286 = 15,734.27 Hz, down from 15,750. That’s 1000/1001. Fields 59.94, frames 29.97.]

[Matt Parker’s Stand-up Maths video tells this one well; link it here.]

The 1001 problem
sound 4.5 beat (made in the TV) color luma MHz above the picture carrier beat, in multiples of the line rate · gray teeth are luma
the beat on the picture · one field
line rate Hz
field rate (÷ 262.5)
frame rate (÷ 525)
color subcarrier (× 227.5) MHz
sound ÷ line rate
beat (sound − subcarrier) kHz
beat ÷ line rate

At the black-and-white line rate, the beat between color and sound lands a fifth of the way past a luma tooth instead of halfway to the next, and on screen that is a coarse diagonal pattern. Nudge the line rate down by one part in a thousand and the beat lands exactly halfway: the pattern flips phase on every line and all but vanishes from a normal viewing distance. The sound carrier couldn't move without breaking every TV already sold, so the line rate did, and the field rate and frame rate went with it.

Drop-frame timecode

[Count 29.97 as if it were 30 and the timecode falls 108 frames (3.6 s) behind the clock every hour. Drop-frame skips the numbers ;00 and ;01 at the top of each minute except every tenth: 2 × 54 = 108. Numbers, never frames.]

Timecode vs the wall clock
wall clock
00:00:00.00
frame 0
non-drop · counts as if 30
00:00:00:00
on time
drop-frame · 29.97
00:00:00;00
on time
    Same frames, three ways of naming them. The frame count is real 29.97. Non-drop pretends there are 30 a second and loses 3.6 seconds an hour. Drop-frame skips two numbers at the top of each minute, except every tenth minute, and stays within a frame or two of the clock all day. Watch the drop-frame counter go from ;29 straight to ;02.

    Overscan and title-safe

    [Overscan is gone; the margins it forced on us never left.]

    The edge the CRT ate
    the whole frame
    0% lost
    A CRT's picture was deliberately made larger than the glass, so that drift, aging and the set's own tolerances never showed a black border. Every set cropped a different amount. So broadcasters drew two boxes: action-safe, where anything important had to happen, and title-safe, where text had to stay. Flat panels show every pixel, but the boxes are still in every NLE and many TVs still overscan by default.

    Non-square pixels

    [Standard definition was sampled at 13.5 MHz, chosen because it divides cleanly into both the NTSC and PAL line rates. That gives 720 samples per line, of which about 704 are picture. Which width you call “4:3” is why two sets of pixel aspect ratios are in circulation (10/11 vs 0.9 for NTSC 4:3). Calls back to the teapot.]

    Same 720 × 480, three screens
    computer monitor · square pixels ·
    4:3 TV · pixels 10/11 wide ·
    16:9 TV · pixels 40/33 wide ·
    The file is the same 720 × 480 numbers every time. Only the screen changes, and it changes the shape of every pixel. Draw a circle on a computer and it is an egg on a 4:3 TV and a lozenge on a 16:9 one. Draw it for the TV and it is right there and wrong on your monitor. Both standard-definition aspect ratios came out of one 13.5 MHz sampling rate that was picked to suit NTSC and PAL at once. The picture lives in the middle 704 samples; the other 16 are spare room.

    Guard bands and signal bleed

    [A real signal isn’t a point on the dial; it has skirts. Push it harder than the transmitter can follow and it clips, and clipping makes new frequencies that land in someone else’s channel. The guard band is the whole idea: leave room, because nothing is as clean as the spec.]

    Stay in your lane
    kHz
    envelope · dashed: what the program asked for
    modulation depth%
    power in our slot
    power in the neighbors' slots
    Below 100% the transmitter does exactly what the program asks, and every bit of power stays in our slot. Push past 100% and the envelope would have to go below zero, which a transmitter can't do, so it flattens instead. A flattened wave is made of new frequencies the program never had, and they splash into the channels next door. The empty gaps between slots are guard bands: room for the signal everyone hopes nobody sends.

    Broadcast-safe color

    [In composite video the color rides on top of the brightness as a 3.58 MHz sine. Bright saturated colors (yellow, cyan) swing the signal above the 120 IRE ceiling; dark saturated colors (blue, red) dip below −20 into sync territory.]

    [Too bright: NTSC transmitters use negative modulation (white means the least carrier), so the peak cuts the carrier off entirely. TV sound is recovered by beating against that carrier, so the picture comes out of the speaker as a buzz. Too dark: the set can mistake picture for sync and lose lock. That’s what the “legal colors” filter in your NLE is protecting.]

    [Side note: US NTSC put black at 7.5 IRE (“setup”); Japan and PAL at 0. One reason your black was gray on someone else’s deck.]

    [Sound has its own version. TV audio is FM: louder means a wider swing in frequency, and pre-emphasis boosts the highs before they go out, so a hot, bright mix swings past its allotted deviation and into the neighbors. The loudness specs you deliver to today (ATSC A/85, EBU R128, measured in LUFS) are a different story: people complained that ads were louder than the shows, and in the US the 2010 CALM Act made it law.]

    What a color does to the transmitter
    you asked for
    what goes on air
    one scan line · 63.5 microseconds · subcarrier drawn slower than life 100% 0 the transmitter's carrier · negative modulation, so bright = less
    above 120 IRE: carrier cut off, sound buzzes below −20 IRE: picture looks like sync
    lumapeaktroughleast carrier
    asked for
    In composite video the color isn't a separate channel. It's a sine wave riding on the brightness: the more saturated the color, the bigger the swing. Saturated yellow is already bright, so its swing pokes over the top. Saturated blue is dark, so its swing dips toward sync. That is why color bars are usually 75%, and why your NLE has a broadcast-safe filter. It isn't protecting the picture; it's protecting the transmitter and the sound.

    Legal range (16–235)

    [Video levels keep codes in reserve. Below black and above white is room for filter ringing on hard edges; the very ends (0 and 255 in 8-bit) are reserved for timing codes in SDI. Full range clips the ringing; legal range keeps it.]

    Room for the ringing
    across the edge, in samples

    0.00
    Nothing analog or band-limited makes a perfectly square edge. It rings, a little above white and a little below black. Legal range keeps fifteen usable codes below black and nineteen above white so the ringing survives the trip and the next filter downstream can put the edge back together. Store the same edge in full range and the ringing is sheared off. Sharpen hard enough and even legal range runs out.

    44.1 kHz audio

    [Early digital audio was mastered on PCM adaptors recording onto video tape. 3 samples per line × 245 lines × 60 fields = 44,100. PAL gets there too: 3 × 294 × 50. (On 59.94 NTSC it was really 44,056.) Broadcast and film went with 48 kHz. Your sample rate mismatch is a television artifact.]

    Audio disguised as video
    one field
    samples per line, per channel3
    usable lines per field
    fields per second
    sample rate
    samples so far, per channel
    The number on every CD comes from a video recorder. Three samples on each usable line, 245 lines a field, 60 fields a second: 44,100. PAL's longer fields at a slower rate land on the same number, which is why it was picked. On a color NTSC deck running at 59.94 it came out at about 44,056, a rate that briefly existed for exactly that reason.

    sRGB vs gamma 2.2

    [Everyone’s been doing it slightly wrong, and the wrongness is small enough nobody notices, except in the deep shadows. The curve explorer in So, the colors are in the computer? puts the two curves side by side.]

    Two curves everyone calls the same
    code value → light → code value (8-bit) → sRGB brighter by (stops)
    codes 0–64 decoded as sRGB
    the same codes decoded as gamma 2.2
    code
    light, sRGB
    light, gamma 2.2
    difference
    sRGB was written to approximate a CRT's 2.2 gamma, with a short straight line at the bottom so the curve has a finite slope at black and can be inverted cleanly. Most software calls the result "gamma 2.2" and many displays implement exactly 2.2. Above about a tenth of the range nobody could tell. In the deepest shadows the two disagree by stops, which is why dark gradients look different on two "sRGB" screens.

    Color temperature: warm is cold

    [Physics isn’t backwards; our words are. A hotter blackbody glows bluer, so 10,000 K is the “cool” one and 2,700 K is “warm”.]

    Warm is cold
    380 nm 700 nm
    ← colder · physics · hotter → ← warm · the words we use · cool →
    temperature
    mired (10⁶ ÷ K)
    looks like
    Heat a lump of iron and it glows red, then orange, then yellow-white. Hotter than any stove, it would go blue. Color temperature is that scale, borrowed for light sources. Somewhere along the way the art world called the low, orange end "warm" and the high, blue end "cool", which is exactly backwards from the thermometer. Both are right; they just aren't talking about the same thing.

    The queue

    [Candidates awaiting a yes or no; numbers match the plan.]

    • 18. 24 fps: the cheapest speed sound-on-film would tolerate
    • 19. 4:3 from Edison’s film gauge; 16:9 as the geometric mean of 4:3 and 2.35
    • 20. The “4” in 4:2:0 is four times the NTSC subcarrier
    • 21. Luma isn’t luminance: Rec.601 vs Rec.709 coefficients
    • 22. 1080 is stored as 1088
    • 23. The 0.5 pixel center offset
    • 24. Powers-of-two textures
    • 25. 72 dpi
    • 26. 18% gray vs what light meters assume
    • 27. Never Twice the Same Color, and how PAL fixed it
    • 28. Test objects: the Stanford bunny, the Cornell box, Lenna

    Glossary

    Key terms used in this guide. In the prose, underlined-dotted terms show their short definition on hover or focus, and jump here on click.

    Field
    One pass of an interlaced picture: only the odd lines, or only the even. NTSC sends 59.94 a second, PAL 50.
    Field order
    Whether the upper or lower field comes first in time. Backwards, motion steps back every other field.
    Line rate
    Lines drawn per second. Black-and-white NTSC: 15,750. Color NTSC: 15,734.27, slowed by 1000/1001.
    Color subcarrier
    A sine wave (3.579545 MHz in NTSC, 4.43361875 MHz in PAL) whose phase and amplitude carry hue and saturation on top of the black-and-white signal.
    Hum bar
    A dark band from power supply ripple at mains frequency. It sits still when the field rate is locked to the mains, and rolls when it is not.
    Pulldown
    Spreading 24 film frames across 60 video fields by holding them alternately for 2 and 3 fields (2:3).
    Drop-frame
    Timecode that skips frame numbers ;00 and ;01 each minute except every tenth, so 29.97 keeps up with the clock. No picture is dropped.
    Pixel aspect ratio
    A pixel’s displayed width over its height. Standard-definition pixels were not square: 10/11 for NTSC 4:3, by one convention.
    Overscan
    The outer edge of the picture that old TVs cropped. Title-safe and action-safe margins exist to survive it.
    IRE
    A unit of composite video level: 0 is blanking, 100 is reference white. US NTSC put black at 7.5 (“setup”).
    Newton's method
    Refining an approximate answer by following the slope of the error back toward zero. Each step roughly doubles the correct digits.
    Guard band
    Unused frequency left between channels so real, leaky signals don’t bleed into their neighbors.

    Extra reading

    ← Back to guides