Work / 2048 Drop

Coming soon to the App Store

I gave a puzzle game
real ray tracing.

2048 Drop is a drop-and-merge game where the pieces are glass. You drop a cube into a recess in a sunlit wall, and when two of the same number touch, they merge into the next one. They’re solid things, too. They bounce, tumble and lean on each other, and one merge can tip the pile into the next.

On iPhone 15 Pro and newer, all of that glass is ray traced, every frame. It’s coming to iPhone and iPad. No date yet.

A screen recording from my iPhone, with ray tracing on. The game is playing itself here.
In the game

Then one day you make 2048.

And time slows down so you can watch it happen. That’s not the end, either. Keep going and you get to find out what an 8192 does.

The finale for a first 2048, recorded on my iPhone. I set this board up for the camera.
How it plays
Drag to aim, let go to drop. One finger. Chain merges and the score multiplies.
Daily Drop
One run a day where everyone in the world gets the same cubes in the same order. You get one scored attempt.
Sound
Every clink and every merge is a recording of real glass. Headphones help.
Game Center
Seven leaderboards and 14 achievements, some of them hidden.
Devices
iPhone and iPad. On the iPhone Duo it follows the hinge: stand it up like a laptop and the pile reflects in the half lying on the table.
Price
Free, with no ads, ever. One optional purchase adds two more themes and two more icons.
Privacy
No account, no tracking, nothing collected. The details are on the privacy page.
Themes

Three times of day.

A theme is the same wall at a different hour. Golden Hour is the one you start with. Sunset warms the whole thing up. Obsidian keeps the daylight and swaps the sill for polished black stone, so the pile gets a reflection.

The same pile of glass cubes at sunset: the plaster wall has turned a warm gold.
A pile of colored glass cubes on a sill in a pale plaster wall, lit by afternoon sun.
Golden Hour Sunset
Same wall, same cubes, different hour · drag to compare
Close-up of the glass cubes on a polished black sill, each one reflected in the stone beneath it.
Obsidian. Rendered by the game’s own tracer, like the two beside it.
How it’s built

The cubes aren’t meshes.

The refraction is computed per pixel on the iPhone’s ray tracing hardware. Light bends through each cube, picks up its color on the way through (Beer–Lambert absorption), and lands on the wall behind it as a colored shadow.

Each cube is a signed distance field, and the ray marches along it to find the true rounded surface. So the edges are mathematically round instead of faceted, and the code knows exactly how far light traveled inside the glass.

At the edges and corners, a six-wavelength spectral fan splits the light into visible prism fire. Only there, because that’s the only place real glass does it.

For a while the cubes looked like they had square corners, which is not great on a game whose whole bit is realistic glass. I went after the geometry twice. Didn’t fix it either time. So I built a debug mode that paints every bounce of every ray its own color, and the edges came back perfectly round. The geometry had been fine the whole time. Right at the edge of a cube, glass basically turns into a mirror, and there was nothing off to the side for it to reflect, so the rims went black. And a black outline looks exactly like a hard corner. The fix was hiding a couple of studio lights just out of frame, which is the same trick product photographers use to give glass clean edges.

Close-up of glass cubes numbered 8, 32, 16 and 256 stacked against a sunlit plaster wall. Their edges are rounded, the black numerals are inlaid in the faces, and you can see through each cube to the ones behind it.
The rounded edges come from the SDF, not a beveled mesh. The numerals are inlaid black enamel.
Renderer
Metal, hardware RT
Ray traced on
iPhone 15 Pro and newer
Older phones
Full SceneKit path
Physics
SceneKit