PärPod by Claude
PärPod by Claude
PärPod by Claude
Hillshade: How a Grid of Numbers Pretends to Be a Mountain
5m · May 30, 2026
Hillshade: How a Grid of Numbers Pretends to Be a Mountain

Hillshade: How a Grid of Numbers Pretends to Be a Mountain

A Photograph of a Place That Was Never Lit

You swapped your terrain shading source last week, from a global dataset to the Swedish mapping authority's own height grid, the fine fifty-meter one. You pulled seventy-six tiles, a gigabyte and a half, melted them into a single array of numbers, and out the other end came something that looks, convincingly, like a photograph of mountains taken in low afternoon sun. Ridges catch the light. Valleys fall into shadow. Your eye reads three dimensions instantly. But nothing was ever lit, and no photo was ever taken. There is no sun. There is only a grid of heights and some arithmetic that fools your brain on purpose. The fooling is the whole craft, and it is worth knowing how the trick is done.

A Grid of Heights, Nothing More

Strip away the picture and what you actually have is dull. A vast checkerboard, and in every square a single number, how high the ground is at that spot. Meters above the sea. That is it. No color, no shadow, no light, no shape your eye can grab. If you painted each square a shade of grey by its height, low dark and high bright, you would get a vague, flat, milky blob. Technically correct and visually useless. Height alone does not look like terrain, because your eyes did not evolve to read absolute elevation. They evolved to read light falling across a surface. So to make height look like land, you have to invent a sun.

The first real step is to stop caring about how high each square is and start caring about how it tilts. Take any square and look at its neighbors. If the square to the west is much higher than the square to the east, the ground here is sloping steeply downhill toward the east. From the heights of the neighbors all around, you can work out two things for every single square. How steep it is, and which compass direction it faces. Steepness and facing. That pair is the secret, because those are the things that decide how light would land if there were any light.

Inventing a Sun

Now place an imaginary sun in the sky. Give it a direction, say it sits in the northwest, and a height above the horizon, say low, late-day low. The sun sends parallel rays down across your whole grid. For each square, you already know which way it faces and how steeply. So you ask one question. How squarely does this little tilted facet face the sun. A slope that turns directly toward the sun catches the rays full on and should be painted bright. A slope that turns away sits in its own shadow and should be painted dark. A slope edge-on to the light lands somewhere in the grey middle.

The arithmetic that answers, how squarely does this face the sun, is a single, ancient operation. You compare the direction the slope faces against the direction the sunlight comes from, and you get a number between fully lit and fully turned away. Run that for every square, paint each one its brightness, and the flat milky blob snaps into relief. Mountains rise. Gullies cut. The shape was always in the numbers. The invented sun is just what lets your eye finally see it. That is a hillshade. A picture of how a made-up light would fall on a real surface.

Why One Sun Is Not Enough

Here is the flaw that pushed you toward the fancier method. A single sun has a cruel side effect. Anything that happens to face along the line of the light, neither toward it nor away, goes flat and featureless, and worse, a long ridge can sometimes read as a valley and a valley as a ridge, your brain flipping the whole shape inside out because the lighting is ambiguous. Cartographers have known this headache for a century. A single hard light is dramatic but it lies in the directions it does not favor, and it swallows detail in the directions it does.

The cure is to stop using one sun and use several. Light the terrain from a few directions at once, from the northwest and the west and a couple of others, and blend the results together, usually weighting the classic northwest light most heavily. That is what multidirectional means. No single direction gets to flatten or invert anything, because another light from another angle fills in what the first one lost. The result is gentler and far more honest. Detail survives everywhere instead of only on the slopes that happened to face the one lamp. It costs more arithmetic, several shadings instead of one, but your machine ran the whole country in about seventeen minutes, so the cost is nothing and the readability is everything.

The Keeper

So the next time a relief map of Jämtland looks like you could reach in and feel the ridgelines, hold the trick in your head. Underneath is only a grid of bare heights, no shape your eye can use. From each square's neighbors you recover how it tilts and which way it faces. You invent a sun, and for every square you measure how directly it would catch that light, bright facing in, dark turning away. And because one sun lies in the directions it ignores, you light the land from several angles and blend them, so nothing gets flattened and no ridge pretends to be a ravine. There is no photograph. There is no afternoon. There is a number in every square and a sun you made up, and together they are enough to fool the oldest part of your eye into seeing a mountain.