Pocket3D

Pocket3D is a hardware-native 3D stack for portable interactive software.

  • A green tram passes a level crossing above the sea.
    Pocket Atlas on a PS Vita
  • A street of timber houses with a tower at its end.
    Pocket Maneuver on a PSP
  • A grid of city lights seen from a hilltop terrace at dusk.
    Pocket Atlas on a PS Vita
  • A street view on the upper screen and a town plan on the lower screen.
    Pocket Maneuver on a 3DS
  • A first-person view of a sunlit courtyard with crates and a rifle.
    OpenStrike on a PSP
  • A convenience store at night, reflected in wet ground.
    Pocket Atlas on a PS Vita
  • A figure on wires flies over the red roofs of a walled town.
    Pocket Maneuver on a PS Vita
  • Stone stairs between buildings under a tree, in hard sunlight.
    Pocket Atlas on a PS Vita

Hardware-native

Built to use each machine in full.

Most cross-platform engines flatten every console down to what they all share. Pocket3D is designed the other way round. A game gets a renderer for each machine, so the PSP's fixed pipeline, the 3DS's glasses-free 3D screen and the Vita's GXM driver are all there to be used.

One renderer has to run on all three, so it draws with what all three share. Everything above the line goes unused. A renderer for each machine keeps everything above the line in reach.

PSP GE, 2004

  • palette textures
  • GE bone blending
  • fixed pipeline

16 → 7 msThe GE has no shaders, so lighting is baked into vertex colours and textures are packed as palettes. A street's GE time dropped by more than half.

Nintendo 3DS PICA200, 2011

  • glasses-free 3D
  • a second screen
  • PICA fog table

250 → 60 drawsOne position grid for the whole world lets a run of meshes go out in one call. The lower screen carries the town plan.

PS Vita GXM, 2011

  • bloom, light shafts
  • 4× MSAA
  • Cg shaders

0 late framesCg programs are compiled on the device. The scene renders at 960 × 544 with 4× MSAA and a post chain, and still holds 60 fps.

textured, lit triangles

Compiler-first

One source of truth, compiled for every target.

The game is modelled once, as Three.js content that runs in a browser. A compiler lowers that semantic scene to each platform, the way LLVM takes one program to many processors. Hardware-native depends on it: each back end is free to emit what its own GPU wants.

front endIRback ends, as Pocket Maneuver has them

Three.js scene

Meshes, materials, lights and motion, with a note on each part that says what it is.

  • sign
  • water
  • light field
  • sky

Scene IR

The scene as meaning, with no GPU in it yet.

  • surfaces
  • signs
  • lights
  • models
  • collision

PS Vita GXM

BC1 atlas, 16-byte vertices, Cg programs

Nintendo 3DS PICA200

RGB565 Morton tiles, one world grid, meshes in runs

PSP GE

8-bit palette pages, 12-byte vertices, clip groups

LLVM does the same C, Rust, Swift→LLVM IR→x86, ARM, RISC-V
PS Vita capture: an observatory at dusk with a city skyline behind it. The same view rendered by the Three.js reference in a browser.
Griffith Observatory in Pocket Atlas. Drag to compare the source of truth with what the compiler made of it for one machine.

Purpose-built engines

Every game gets an engine of its own.

Pocket3D is not one engine that every game has to squeeze into. Each game builds on it with its own scene DSL, its own IR and its own renderers, and all three are tuned to that one game.

PS Vita capture: a convenience store at night, reflected in wet ground.

Pocket Atlas

Real places, at the best image a handheld holds at 30 fps.

  1. DSLa place kitsigns, glass, water, light fields
  2. IRPlaceIRglTF with a note on what each part is
  3. renderersGXM, PICA200reflections, rain, 52,000 point-sprite lights
PS Vita capture: a figure on wires flies over the red roofs of a walled town.

Pocket Maneuver

Wire traversal through a town of 5,400 houses, at 60 fps.

  1. DSLa town generatorbands, blocks, row houses, one strip atlas
  2. IRWorldIRcells, levels of detail, a collision world
  3. renderersGXM, PICA200, GEruns of cells in one draw, clip groups on the PSP
PSP capture: a first-person view of a sunlit courtyard with crates and a rifle.

OpenStrike

A round-based shooter on classic maps, locked at 60 fps on a PSP.

  1. DSLmaps and rulesBSP maps, TypeScript rounds, a JSX HUD
  2. IR.p3dvisibility solved before the game runs
  3. renderersGE, GXM, GLES2only what the camera can see reaches the GPU

Pocket3Ddevice kernels and toolchains: GXM memory and patching, GE frame storage, PICA texture storage

Built for coding agents

Making a game is writing code.

The whole workflow is an agent writing Three.js and a scene DSL. There is no editor to click through and no binary scene to edit by hand, so a game, or any rich interactive scene, can be made entirely by coding. Every step after the writing is a command the agent runs.

youThe LED band over the Radio Kaikan shopfront should chase, like the real one.

agentAdded a 32-frame flipbook sign on the band. On the Vita it costs what a still sign does.

// Housing: yellow steel, the face covered by the LED bars.
const housing = lib.plain(0xc9a20e, 0.5, 0.2);
w.mesh(box(bw, bh, zf + 0.3), housing, …);

const sign = w.addSign(new Sign("kaikan-band", tex,
  new Color(1.9, 1.7, 1.25),
  { flipbook: { frames: 32, cols: 1, rows: 32, fps: 6 } }));
w.mesh(frameUV(new PlaneGeometry(bw - 0.06, bh - 0.06), 1, 32),
  sign.material, …);
PS Vita capture: the Radio Kaikan building at dusk, its facade covered in lit signs.

The same sign on a PS Vita, at 30 fps. An example exchange; the code is abridged from Pocket Atlas.

1

Write

Three.js and the scene DSL. It runs in a browser at once.

bun run dev
2

Compile

Lower the scene to one console's formats, with budgets checked.

bun tools/maneuver.ts cook
3

Deploy

Replace the binary running on the console.

bun tools/maneuver.ts native
4

Measure

Fly a fixed route and read back the late frames.

bun tools/maneuver.ts bench

read the numbers, write again

Build the next one

The GXM, GE and PICA device kernels are open source in the PocketJS repository, with the toolchain pins they build on.