Professor Oops

Light and shadow

Light and shadow

Ketchup, puddles and pencil dents stand off the page, and one light shows every bump

Squeeze ketchup onto the page and it stands up off the paper. It shines along its top edge and throws a small shadow down to the right, as it would on a real table. Every spot of the paper keeps its own height, so paint, dents, puddles and burnt edges are all lit by the same light. And hold a magnifying glass still over the paper, and the sun's light gathers into a spot hot enough to set it alight.

A ketchup zigzag on paper, lit with the game's height-field lighting: its top edge shines and it throws a short shadow to the lower right.

Every spot of the paper keeps its own height

The simulation underneath doesn't hand the screen a picture. It hands over numbers for every spot of the paper: how much colour has soaked in, how wet it is, how thick the ketchup lies, how charred it is. To draw a frame, the game adds some of those numbers up into a single height for each spot, and lights the result.

So the relief you see is made of things the game already keeps. Press hard with a pencil and the dent is a low line. Wet the paper and it goes wavy, and once it dries it never goes completely flat again, until you iron it. A colouring page's outlines are low ridges, raised so that paint pools inside the shapes. Paint and ketchup stand as tall as they lie thick. Burnt paper lifts at its edges, and a burnt hole is a pit you see the table through.

The dents and waves aren't painted on. Water and paint flow over the same ground height that the light shades, so the low place you see is the low place a puddle runs into. A few bumps are mostly for the eye. The lift of a burnt edge and a laid wire are lit, but they don't steer the flow, and the paper's fibre steers it only when the page is tilted.

Ketchup, puddles and pencil dents stand off the page, and one light shows every bump

For engineers

Ketchup, puddles and pencil dents stand off the page, and one light shows every bump

A fragment shader lights one height field on a sheet of up to 512 × 384 cells, rebuilt wherever it changes from the simulation's own fields: dents, wet cockle, fibre, liquids, water, char and holes. Normals come from the field itself; a short, bounded ray march toward one fixed key light, about 45° up from the upper left, gives soft shadows; a few samples give ambient occlusion; Blinn-Phong adds shine per material. Colour follows the Beer-Lambert law in three channels. The one light that heats is the magnifying glass, whose focus builds while it's held still and whose heating grows steeply with that focus.

Under the hood
Every spot of the paper keeps its own height

Under the hood

Every spot of the paper keeps its own height

The height of each cell, measured in cells, is a weighted sum of fields the simulation already keeps: pressed dents and wet cockle, the paper's fibre, the thickness of any liquid, the water film, floating layers, dough and wires, a lift where paper has charred and a pit where it has burnt through.

  • The height lives in a half-float texture, so it is clamped: an overflow would light as NaN, a black pixel.

  • Cockle is state, not decoration. It rises toward how wet the paper is, sinks slowly once dry, and keeps a permanent floor, so dried paper never lies quite flat. The iron and the roller flatten it.

  • A colouring page raises the ground a little along its lines.

  • The sum can be built on the CPU or on the GPU, from textures that are uploaded anyway; only the rare exceptions travel separately. An automated test holds the two within two half-float steps of each other, cell for cell.

What adds to the height

A cross-section, heights exaggerated. Each part adds to, or takes from, the one height the light reads: the fibre a faint grain, a pressed dent lowers the ground, a page outline is a low ridge, paint adds its own thickness, a water film its depth, a burnt edge lifts a little, and a hole is a pit.

A cross-section of the paper showing what adds to its height: fibre, a pressed dent, a colouring-page ridge, a blob of paint, a film of water, a burnt edge lifting and a hole as a pit.
  • fibre
  • pressed dent
  • page outline
  • paint
  • water film
  • burnt edge
  • hole
  • flat paper

One light from the upper left shades every slope

One light hangs over the page, up and to the left, about 45° above the table. Each spot is lit by how squarely its surface faces that light. The side of a blob that faces up and left is bright; its far side is darker. A spot that sits lower than the paper round it gets a little less light from all around, so the bottom of a dent looks deeper than its slopes alone would show.

Colour comes in underneath the light. In the game a colour is how much light the paper's ink or paint takes away, channel by channel, so two thin layers darken together, as the Beer-Lambert law describes for light through a dye Swinehart 1962. Wet paper is a little darker, and standing water tints it faintly blue-grey. The colour chapter has the whole story of mixing.

Liquids get one more touch. Surface tension pulls a real liquid's small bumps flat, so on paint and ketchup the shader tones down slopes a cell or two across and keeps the big shape. Without it, every cell would light as a little facet and a puddle of sauce would sparkle like gravel. This is a choice about the look; the picture doesn't compute surface tension.

Under the hood
One light from the upper left shades every slope

Under the hood

One light from the upper left shades every slope

Per pixel, the classic split into light from round about and light from the key, with one fixed key light about 45° up from the upper left:

lit = colour × (ambient × occlusion + direct × diffuse × shadow) + highlight × shadow

ambient and direct: the light from round about and from the key. occlusion, diffuse and shadow: how much of each reaches the spot.

  • The surface normal comes from the height field's slope, by central differences.

  • Occlusion compares a spot with a few neighbours' heights: a spot lower than its surroundings gets less light from round about, down to a floor.

  • Matte liquids use wrapped diffuse lighting, so their shading rolls off softly instead of cutting to dark.

  • Colour is the paper's colour times e to the minus the absorbance, per channel, the Beer-Lambert law; wet paper darkens a little and standing water tints it.

  • Liquids split their slope into a broad shape and fine detail, and compress the fine part, a cheap stand-in for surface tension.

Try it: shape the paper and watch the light The game's own rule

Three blobs of paint, 0.8, 2 and 6 cells tall from left to right, a pressed line and a puddle, lit by the shader's own sums on a 160 × 120 sheet. Pick a tool and drag on the paper, or press Use the tool. What to look for: the two smaller blobs are shaded but throw no shadow, and the tall one throws a short one to the lower right; a dent is dark on its upper-left wall; drop the shadow steps and short shadows vanish. Our simplifications: the blobs' shapes are ours, the paint's colour is one flat red, and the paper's fibre is our own noise with the game's weights.

A small sheet of paper lit by the game's height-field shader: three paint blobs, a pressed line and a puddle.
Tool
Shadow steps
0.85
height at the ring
—
key light reaching it
—
brightness vs flat paper
—
cells in a cast shadow
—
In the game, a ketchup zigzag and three thick blobs of paint lit from the upper left, with bright upper-left edges and short shadows to the lower right, beside a thin watercolour wash that is shaded but throws no shadow
Thick throws a shadow, thin only shades, in the game. Ketchup and paint stand tall enough for the walk toward the light to find them. The watercolour wash is too thin to cast anything.

Thick blobs throw shadows, thin washes only shade

For every spot, the shader takes a short walk toward the light, in a handful of steps, and checks at each step: is anything here taller than the line of light coming down to me? If it is, the spot is in shadow. The further away the thing in the way, the softer the shadow it makes, as a real shadow blurs the further it falls from what casts it.

The line of light climbs about one cell for every cell it travels, and the first check is a little way off. So only something clearly taller than a spot can throw a shadow onto it, and it has to rise steeply: a slope gentler than the light's own 45° never gets above the line of light, however tall it grows. A dent, a watercolour wash or a film of water is lower than that. Their slopes are shaded, but they never cast. A blob of thick paint or a ridge of ketchup stands taller and does.

On a slower tablet the walk takes fewer, longer steps, so the smallest height that casts rises a little. The page still has its shadows; only the shortest ones go. Even the deepest shadow keeps some of the key light, and all of the light from round about, so nothing on the paper turns black.

Under the hood
Thick blobs throw shadows, thin washes only shade

Under the hood

Thick blobs throw shadows, thin washes only shade

A height-field ray march, per pixel, toward the key light over a fixed short distance. Each step compares the terrain with the rising line of light and keeps the darkest result; the step count drops with the device's quality level.

  • Each step samples the height more than once, or a crumb one cell wide is only hit now and then and casts a dotted line.

  • The shadow's edge softens with distance from the caster, a cheap penumbra. Close to the caster, the height is averaged across the ray, so a lumpy ridge casts a soft edge, not a row of spikes.

  • Cost is bounded: a few dozen texture fetches per pixel at most, whatever is on the page.

  • Long shadows are cut off at the end of the walk. That's the price of a bounded cost per pixel.

Try it: walk toward the light The game's own rule

A side view along the light's direction. The light comes from the upper left. From the marked spot, the walk checks its steps toward the light; a red check is one where the bump stands above the line of light. The strip under the paper shows how much light every spot keeps. Drag along the paper to move the spot, or use the slider. What to look for: below 1.6 cells the bump throws no shadow at all, and with fewer steps the threshold rises. Around 2 cells this rounded bump still casts nothing, because its sides are gentler than the light. This side view leaves out the averaging across the ray close to the caster.

Side view of a bump on paper with the shader's walk toward the light from one spot, and a strip showing how much light each spot keeps.
  • key light, 45° up
  • strip: light kept
  • the bump
  • the marked spot
4.0 cells
Steps
16.6 cells
first check
—
light kept at the spot
—
shadow beyond the bump's foot
—
Nothing under 1.6 cells tall throws a shadowThe deepest shadow never takes all of the key light.

At the best quality a ledge starts to take light away at 1.6 cells; with 7 steps at 2.3, with 6 at 2.7. Even 6 cells tall it takes 75 % of the key light at best quality, never all of it.

Nothing under 1.6 cells tall throws a shadow0.00.20.40.60.80123456height of a long ledge above the spot at its foot (cells)key light taken away1.62.32.7Nothing under 1.6 cells tall throws a shadow0.00.20.40.60.80246height of a long ledge above the spot at i…key light taken away1.62.32.7
  • best quality, 10 steps
  • 7 steps
  • lowest, 6 steps
Data table
Nothing under 1.6 cells tall throws a shadow
height of a long ledge above the spot at its foot (cells)best quality, 10 steps7 stepslowest, 6 steps
0000
0.05000
0.1000
0.15000
0.2000
0.25000
0.3000
0.35000
0.4000
0.45000
0.5000
0.55000
0.6000
0.65000
0.7000
0.75000
0.8000
0.85000
0.9000
0.95000
1000
1.05000
1.1000
1.15000
1.2000
1.25000
1.3000
1.35000
1.4000
1.45000
1.5000
1.55000
1.60.000800
1.650.014400
1.70.02800
1.750.041600
1.80.055200
1.850.068800
1.90.082400
1.950.09600
20.109600
2.050.123200
2.10.136800
2.150.150400
2.20.164100
2.250.177700
2.30.19130.00460
2.350.20490.01710
2.40.21850.02970
2.450.23210.04230
2.50.24570.05480
2.550.25930.06740
2.60.27290.080
2.650.28650.09250
2.70.30010.10510.0091
2.750.31380.11770.0212
2.80.32740.13020.0333
2.850.3410.14280.0453
2.90.35460.15540.0574
2.950.36820.16790.0694
30.38180.18050.0815
3.050.39540.19310.0935
3.10.4090.20560.1056
3.150.42260.21820.1176
3.20.43620.23080.1297
3.250.44980.24330.1417
3.30.46350.25590.1538
3.350.47710.26850.1658
3.40.49070.2810.1779
3.450.50430.29360.1899
3.50.51790.30620.202
3.550.53150.31870.2141
3.60.54510.33130.2261
3.650.55870.34390.2382
3.70.57230.35640.2502
3.750.58590.3690.2623
3.80.59950.38160.2743
3.850.61320.39410.2864
3.90.62680.40670.2984
3.950.64040.41930.3105
40.6540.43180.3225
4.050.66760.44440.3346
4.10.68120.4570.3466
4.150.69480.46950.3587
4.20.70840.48210.3708
4.250.7220.49470.3828
4.30.73560.50720.3949
4.350.74920.51980.4069
4.40.750.53240.419
4.450.750.54490.431
4.50.750.55750.4431
4.550.750.57010.4551
4.60.750.58260.4672
4.650.750.59520.4792
4.70.750.60780.4913
4.750.750.62030.5033
4.80.750.63290.5154
4.850.750.64550.5274
4.90.750.6580.5395
4.950.750.67060.5516
50.750.68320.5636
5.050.750.69570.5757
5.10.750.70830.5877
5.150.750.72090.5998
5.20.750.73340.6118
5.250.750.7460.6239
5.30.750.750.6359
5.350.750.750.648
5.40.750.750.66
5.450.750.750.6721
5.50.750.750.6841
5.550.750.750.6962
5.60.750.750.7083
5.650.750.750.7203
5.70.750.750.7324
5.750.750.750.7444
5.80.750.750.75
5.850.750.750.75
5.90.750.750.75
5.950.750.750.75
60.750.750.75

Source: Computed from the game's own shadow march, with its key light and its step counts for each quality level.

Things on the page throw their shadows down and to the right

Objects you put on the page, such as a cup, are paintings laid over the paper. Each one throws a faint, dark-brown copy of its outline, shifted down and to the right by how high it stands. The direction matches the page's light to within half a degree, so a cup's shadow and a blob's shadow point the same way.

Their lengths don't match, and we'd rather say so. An object's shadow is about half as long as the relief's light would throw it. The objects' rule was lined up with the light's direction by hand; its length was never worked out from it.

A candle flame, burning paper and a lit bulb glow brightly on the page. They are drawn bright, and they light nothing else: no shadow falls from a candle, and the paper beside a flame isn't brighter for it.

In the game, a cup and a toy car on paper, each with a faint shadow falling down and to the right, next to a ketchup line whose own shadow falls the same way
One direction for every shadow. Objects' shadows and the relief's shadows fall the same way, down and to the right.
Under the hood: shadows of things
Things on the page throw their shadows down and to the right

Under the hood

Things on the page throw their shadows down and to the right

  • An object's shadow is its painted silhouette, tinted dark brown and faint, shifted down and to the right in proportion to its height. Its direction agrees with the key light to within half a degree.

  • A lifted object is also drawn a little bigger, as something nearer the eye would be.

  • Creatures and balls follow the same idea with their own offsets.

  • Fire's glow is a colour ramp on temperature in the shader, with noise for flicker. A bulb's halo is drawn over the page.

A puddle shines at its rim, where the water tilts toward the light

Glossy things catch a sharp highlight; matte things get a soft, faint one. Each material carries its own gloss, set by hand: honey and oil are the glossiest, ketchup and paint close behind, and foam is nearly matte. Dry paper has a little, and only very wet paper starts to shine.

Here is a surprise from the geometry. You look straight down at the page, and the light comes in at 45°. A perfectly flat, glossy puddle would bounce that light off at 45° the other way, away from your eye. So the flat middle of a puddle shows almost no glint. The highlight appears only where the surface tilts about 22.5° toward the light, halfway between the light and your eye: the rim of a puddle, the rounded top edge of a ketchup line. That's the same rule a real mirror follows, and nobody had to write "make puddle edges shine".

Under the hood
A puddle shines at its rim, where the water tilts toward the light

Under the hood

A puddle shines at its rim, where the water tilts toward the light

Blinn-Phong with the viewer straight down: the highlight peaks where the surface normal points along the half-vector between the light and the eye. Gloss sets both how sharp and how strong it is.

  • On flat ground the half-vector sits 22.5° off the normal, so a glossy surface's highlight there is vanishingly small. The peak needs a slope of tan 22.5°, about 0.41 cells per cell, toward the light.

  • Paper's gloss rises only when it is soaked; standing water raises it to full.

  • The highlight is tinted a warm white and sits under the cast shadow too.

  • Gloss values are hand-set look values, one per material.

Flat water barely shines; tilt it toward the light and it flashesOn flat ground the highlight is vanishingly small.

Standing water adds 0.000 when flat and peaks at 0.85 at a 22.5° tilt; paint peaks at 0.72, foam at 0.17 and dry paper at 0.068.

Flat water barely shines; tilt it toward the light and it flashes0.00.20.40.60.81.001020304050how far the surface tilts toward the light (degrees)highlight added22.5°: halfway between …Flat water barely shines; tilt it toward the light and it flashes0.00.20.40.60.81.001020304050how far the surface tilts toward the light…highlight added
  • standing water
  • paint
  • foam
  • dry paper
Data table
Flat water barely shines; tilt it toward the light and it flashes
how far the surface tilts toward the light (degrees)standing waterpaintfoamdry paper
000.00010.00980.0135
0.500.00010.01110.0145
100.00010.01260.0156
1.50.00010.00020.01420.0167
20.00010.00030.0160.0178
2.50.00010.00040.0180.0191
30.00020.00060.02020.0203
3.50.00030.00080.02250.0216
40.00050.00120.0250.023
4.50.00070.00170.02780.0244
50.00110.00240.03070.0258
5.50.00160.00330.03390.0273
60.00230.00450.03720.0288
6.50.00330.00610.04080.0303
70.00470.00820.04460.0319
7.50.00650.01090.04860.0334
80.0090.01440.05280.0351
8.50.01230.01880.05720.0367
90.01660.02440.06180.0383
9.50.02210.03120.06650.04
100.02920.03970.07140.0416
10.50.03810.04990.07650.0432
110.04910.06210.08170.0449
11.50.06260.07660.08690.0465
120.0790.09350.09230.0481
12.50.09860.11320.09770.0497
130.12170.13560.10310.0512
13.50.14860.1610.10860.0527
140.17950.18940.1140.0542
14.50.21430.22070.11930.0556
150.25330.25480.12450.057
15.50.2960.29140.12960.0583
160.34220.33020.13450.0596
16.50.39140.37070.13930.0607
170.44290.41230.14380.0618
17.50.49580.45430.1480.0629
180.54910.4960.15190.0638
18.50.60160.53660.15550.0647
190.65210.57510.15880.0654
19.50.69930.61080.16170.0661
200.74190.64270.16420.0667
20.50.77880.67010.16620.0671
210.80890.69230.16780.0675
21.50.83120.70870.1690.0678
220.8450.71890.16970.0679
22.50.850.72250.170.068
230.84590.71950.16980.068
23.50.83290.710.16910.0678
240.81150.69420.1680.0675
24.50.78210.67260.16640.0672
250.74590.64560.16440.0667
25.50.70370.61410.16190.0662
260.65690.57880.15910.0655
26.50.60670.54050.15590.0647
270.55430.50010.15230.0639
27.50.50110.45840.14840.063
280.44810.41640.14420.0619
28.50.39640.37470.13970.0608
290.3470.33410.1350.0597
29.50.30040.29520.13010.0584
300.25730.25830.1250.0571
30.50.2180.2240.11980.0558
310.18270.19240.11450.0544
31.50.15150.16370.10910.0529
320.12420.1380.10370.0514
32.50.10080.11530.09820.0498
330.08080.09530.09280.0483
33.50.06410.07810.08750.0467
340.05030.06340.08220.045
34.50.0390.0510.0770.0434
350.030.04060.07190.0418
35.50.02270.0320.0670.0401
360.01710.0250.06220.0385
36.50.01270.01930.05760.0368
370.00930.01480.05320.0352
37.50.00670.01120.0490.0336
380.00480.00840.0450.032
38.50.00340.00630.04120.0304
390.00240.00460.03760.0289
39.50.00170.00340.03420.0274
400.00110.00240.0310.0259
40.50.00080.00170.02810.0245
410.00050.00120.02530.0231
41.50.00030.00090.02270.0218
420.00020.00060.02040.0204
42.50.00010.00040.01820.0192
430.00010.00030.01620.018
43.50.00010.00020.01440.0168
4400.00010.01280.0157
44.500.00010.01120.0146
4500.00010.00990.0136
45.5000.00870.0126
46000.00760.0117
46.5000.00660.0108
47000.00570.01
47.5000.0050.0092
48000.00430.0084
48.5000.00370.0077
49000.00310.0071
49.5000.00270.0065
50000.00230.0059

Source: The game's Blinn-Phong highlight with its key light and its hand-set gloss per material.

In the game, a puddle of water on white paper: its middle shows no glint, and a thin bright highlight runs along its upper-left rim
A puddle in the game. The shine runs along the rim, where the water's surface tilts toward the light.

Hold the magnifying glass still and its spot gets hot enough to burn

Pick up the magnifying glass and hold it over the paper. At first its spot of sunlight is wide and only warms the paper. Keep still and in about two seconds it tightens to a small bright point that heats many times as fast. Paper browns from 200 °C and catches at about 230 °C. From then on it's the same fire as a match would start, spreading through the same paper (see Heat and fire).

Move the glass and it loosens. Every time it moves on, it loses part of its focus. A quick sweep only warms the paper. A slow drag keeps refocusing between moves, and by the game's own sums it can still set the paper alight.

The light falls on the first thing in its way. Hold the glass over a cup and the cup takes the light; the paper underneath stays below 40 °C, while bare paper beside it catches. An automated test holds the glass both ways and checks this.

next update The glass heats by colour. A black line takes in nearly all the light and white paper sends most of it back, so a dark line heats several times as fast; a test pins that it heats at least twice as fast. Wet paper has to boil dry first, and the glass can light a candle, which a test checks too.

Under the hood
Hold the magnifying glass still and its spot gets hot enough to burn

Under the hood

Hold the magnifying glass still and its spot gets hot enough to burn

The glass writes into the same temperature field as every other heat source, so everything downstream of it is the ordinary heat simulation.

WhatRule
focusbuilds while the glass stays within a small circle; drops by a share each time it moves further
spot sizeshrinks as focus grows
heating at the middlegrows with the square of focus, falling off toward the rim
ceilinga cap well above ignition
scorch, ignitereal paper's: 200 °C, about 230 °C
  • Held still from cold, the middle passes 230 °C in under a second.

  • Worked out on this page with the rule plus heat's conduction and cooling, a quick sweep barely warms the paper and a slow drag passes ignition. Not measured in the game.

  • The sun's power through the glass is real: π·(5 cm)² × 1 kW/m², about 8 W for a 10 cm lens in full sun. It sets what an object in the way receives; the paper's rates are tuned.

  • An object takes in more of it the darker its colour.

  • next update The paper's heating scales with how much light its colours, liquids and metal take in; water boils off first.

Try it: focus the sun The game's own rule

The glass starts held still, then moves on by itself; drag on the paper to take it, or use the buttons. A dark marker line runs across the lower part. What to look for: the spot shrinks and brightens while you hold still, a fast sweep leaves no mark, and a slow drag scorches a trail. Switch to next update and the dark line catches far sooner than the white paper. Focus, spot, heating, ceiling and thresholds are the game's; conduction and cooling are the game's rates for average paper. Where a spot passes 230 °C the game's fire would take over and spread; here we only mark it black.

A magnifying glass over paper: its spot of sunlight tightens and heats while held still, scorching and catching the paper.
Heats by
focus
—
spot across
—
heating at its middle
—
hottest spot
—
Held still, white paper catches in about a secondIn the game, fire takes over at 230 °C (see Heat and fire). An automated test holds the glass still and asks for more than 230 °C and a flame. The dark line is a marker of our choosing.

Held still from cold, the middle of the spot passes 230 °C after 1.25 s on white paper with heat spreading and cooling, 0.90 s with the bare formula, and 0.45 s on the dark line.

Held still, white paper catches in about a second01002003004005000.00.51.01.52.02.5seconds held still, from cold°C at the middle of the spotcatches at 230 °CHeld still, white paper catches in about a second01002003004005000.00.51.01.52.02.5seconds held still, from cold°C at the middle of the spotcatches at 230 °C
  • white paper, heat spreading and cooling
  • white paper, no spreading (the bare formula)
  • dark line, next update
Data table
Held still, white paper catches in about a second
seconds held still, from coldwhite paper, heat spreading and coolingwhite paper, no spreading (the bare formula)dark line, next update
0202020
0.05272846
0.1333570
0.15394393
0.24551115
0.255160138
0.35768160
0.356378183
0.47088207
0.457699231
0.583111257
0.5590123284
0.698137312
0.65106151343
0.7114167375
0.75124184409
0.8133202444
0.85143222482
0.9154244510
0.95165266517
1177291517
1.05189318517
1.1203346517
1.15216376517
1.2230408517
1.25245443517
1.3261480517
1.35277519517
1.4293520517
1.45310520517
1.5327520517
1.55345520517
1.6363520517
1.65382520517
1.7400520517
1.75419520517
1.8438520517
1.85458520517
1.9477520517
1.95496520517
2503520517
2.05506520517
2.1508520517
2.15510520517
2.2512520517
2.25513520517
2.3514520517
2.35515520517
2.4516520517
2.45516520517
2.5517520517

Source: Worked out with the released glass's focus and heating, and heat's conduction and cooling for average paper. Not a measurement of the game.

The burning spot waits until every creature has moved away

An ant crossing under the glass is never burned. Before the light lands, every creature where the spot is, or where it's heading, is told it's in danger and gets out of the way. If one is too big to slide clear in time, the glass does nothing that moment and waits. Creatures aren't excused from heat. The light doesn't arrive while one is there. An automated test runs this for every creature in the game, awake or asleep, with the glass held on it and held beside it. The creatures chapter explains the shared danger they all read.

  1. Every step the glass is held

    Spot burns within 1 s? → warn creatures in the spot and its path

  2. Then

    One still under it? → yes: no light this step; no: heat the paper

The warning goes through the same danger channel every threat uses; a test checks it for every creature.

In the game, the magnifying glass held still over white paper: below its rim, its spot has tightened to a bright point ringed with orange, where the paper under it glows hot
Held still for two seconds. The spot has tightened to a bright point, and the paper under it glows orange: it is past 230 °C and has caught.

The cat chases where the red dot was a moment ago

In the full version, the cat comes with a laser pointer. Shine its small red dot on the paper and the cat chases it, pounces and swats. Flick the dot away quickly and the cat is left behind, because it runs to where the dot was a split second ago. That delay is the cat's reaction time, and it's why a fast flick really does get away.

The cat only counts a light as a dot if it is small. The magnifying glass's spot is never small enough, and the cat never chases anything that burns. When the dot goes out under its paw, the cat counts it as caught, and is very pleased about it. A correlational survey of cat owners, which we found after building this, linked frequent laser play with cats that keep chasing lights and shadows, and mentions the suggestion that never catching the prey may frustrate them Kogan 2021. Letting the cat catch the dot is consistent with that. The dog sees the dot too, and on purpose it doesn't chase it.

Under the hood
The cat chases where the red dot was a moment ago

Under the hood

The cat chases where the red dot was a moment ago

  • Every light spot keeps a short history of where it was.

  • The chase steers at where the dot was one reaction time ago, plus a little at random. The reaction time is a typed value with no source behind it.

  • A lure is any light spot that is small enough, with the power of a real 5 mW pointer. The glass's tightest spot is just too big to count.

  • The dog reads the pointer by name, the one place here that isn't a shared rule.

Try it: outrun the cat Illustration

The dot wanders and now and then flicks away. Drag on the paper to move it yourself, or press Flick the dot. The faint ring is where the cat is aiming: where the dot was one reaction time ago. What to look for: slow moves, and the cat stays on the dot; quick flicks, and it runs to an empty spot first. The history and the reaction delay are the game's (0.13 s); how the cat runs here is ours.

A red dot moves on paper and a cat chases the place the dot was one reaction time ago.
0.13 s
aiming where the dot was
—
cat to dot
—

A magnifying glass melts crayon and sets egg white at the same heat a candle needs

Light touches the other systems through two shared things. The height field ties what you see to where liquids flow. The temperature field takes the magnifier's light and hands it to everything that reacts to heat.

512 × 384
Cells on the largest sheet, each with its own height, lit by one shader.
1 light
One key light from the upper left, about 45° up, for the whole page.
22.5°
The tilt toward the light at which a glossy surface flashes: halfway between the light and your eye.
230 °C
Where paper catches, under the glass as under a match.
8 W
The sunlight a real 10 cm magnifying glass gathers in full sun, and the game's glass too.

Shared: temp

Hold the magnifying glass on crayon, egg white or a bank card

The wax melts, the egg sets, the bank card melts, at the same temperatures a candle or an iron would need; a test checks each.

Heat and fire

Shared: the first thing in the light's way

Hold the glass on a cup on the paper

The paper under the cup stays below 40 °C; bare paper beside it catches. Pinned by a test.

Heat and fire

Shared: danger

Bring the glass over a creature on the paper

It moves away, and the light waits until it has. A test checks every creature.

Animals with their own minds

Shared: covered

Leave a sticker on a painted page for a week in the sun

The colour round it fades and its own shape stays, as big as it was drawn. Pinned by a test.

How colours mix

Shared: ground height

Press a line or let wet paper dry wavy

The light shades the dent, and paint and water flow over the same ground. No test yet follows a liquid into a dent; the liquids and the light read the same ground.

Water in paper

Shared: temp

Focus the glass on an unlit candle

next update The candle lights, as it would from a match or burning paper. Pinned by a test.

Heat and fire

Light always comes from the upper left and shadows stay short, so a cheap tablet keeps up

Light is where a game is most tempted to fake things. We fake some, on purpose, and we say which. The page's relief is computed every frame from real state; the rest are choices that keep the picture readable and the frame fast on a cheap tablet.

In real life. Paper is a surface in 3D, lit from all round, seen from wherever you stand

In the game. One height per cell, one fixed light from the upper left at about 45°, seen straight down

Why that's enough. Everything in the simulation lives in flat fields, and a height per cell is all they hold. There are no overhangs and no light bouncing between things, and gloss is only a highlight.

In real life. A soft shadow from a light with a size

In the game. A short march toward the light in a few steps, fewer on slower tablets, its edge widening with distance; a few samples for light from round about

Why that's enough. A bounded cost per pixel. Long shadows are cut short, and anything very low only shades.

In real life. Surface tension pulls a liquid's small ripples flat

In the game. The shader squeezes the fine part of a liquid's slope

Why that's enough. Without it each cell lights as its own facet and sauce sparkles like gravel. It's a look choice; no surface tension is solved in the picture.

In real life. Paint absorbs light by wavelength across the spectrum

In the game. Three channels, each darkened by the Beer-Lambert law

Why that's enough. Layers and mixes darken as they should. Two paints that match in red, green and blue look the same here even where real ones wouldn't.

In real life. An object's shadow is set by the light

In the game. A silhouette shifted down and to the right in proportion to height

Why that's enough. One cheap draw per object. The direction agrees with the light to half a degree; the length is about half what the relief would cast.

In real life. A flame or a bulb lights the room

In the game. Flames and bulbs glow where they're drawn and light nothing else

Why that's enough. The page has one light. A candle throws no shadow and warms the paper by its heat alone.

In real life. A burning glass needs the sun, and its heat depends on the sun, the lens and the distance

In the game. A fixed 8 W sun that's always out; focus grows while you hold still; heating rates tuned

Why that's enough. The 8 W matches a real 10 cm lens in full sun (7.85 W), and the thresholds are real paper's: browning at 200 °C, catching at about 230 °C. What matters for play is a rule a child can find: hold still and it burns.

In real life. A cat's reaction to a moving dot

In the game. A short typed delay, plus a little at random

Why that's enough. It gives the chase its feel: a flick escapes and a slow drag doesn't. We have no source for the number.