mshumer /Claude-of-Duty

A Call of Duty-quality FPS in Three.js, built from a single prompt.

★ 3,507⑂ 534👁 36▤ 0
JavaScriptCreated 2026-07-26
3,507
stars
+0+3+56
534
forks
36
watchers
–
prs
–
issues
0
releases
–
discussions

README

Claude of Duty

Get updates here.

A first-person shooter built in the browser with Three.js r180 and WebGL2. Roughly
55k lines across 11 subsystems, written by a fleet of AI agents under orchestration.

There are no art assets. Every texture, mesh, animation and sound is generated
procedurally at load time from code. No models, no HDRIs, no image files, no audio
files. The only runtime dependency is three.

bash
npm install
npm run dev           http://127.0.0.1:5173


Click the canvas to lock the cursor. WASD move, mouse aim, LMB fire, RMB ADS,
R reload, Shift sprint, Ctrl crouch, Space jump, Q/E lean, Esc release.

 What's in it

| subsystem | what it does |
|---|---|
| render | HDR pipeline, cascaded shadow maps in a sampler2DArray with texel snapping and PCSS contact hardening, MRT depth/normal/velocity prepass, GTAO, TAA with YCoCg variance clipping, tile-dilated motion blur, Karis bloom pyramid, GPU EV100 metering, procedural 33³ grade LUT, AgX composite |
| materials | GPU texture forge: 19 procedural surfaces (concrete, brick, plaster, asphalt, sand, rusted/painted/brushed metal, wood, fabric, burlap, glass…), periodic noise so everything tiles seamlessly, Sobel height→normal, parallax occlusion mapping, triplanar projection, curvature-driven edge wear |
| sky | Atmospheric scattering, time of day, PMREM environment generation, volumetric fog and light shafts |
| world | ~120×120 m market street: modular building kit with real wall thickness, enterable interiors, several hundred instanced props |
| physics | Written from scratch, no library. Binned-SAH BVH (29k tris → 14k nodes in 22 ms, 0.25 µs/raycast), swept-capsule character controller with a 5-plane crease stack, impulse rigid bodies with CCD, PBD ragdolls, multi-layer bullet penetration |
| player | Movement state machine, slide/mantle/lean, camera feel |
| weapons | Procedural weapon geometry, viewmodel rig, ADS, spring recoil, procedural reloads, ballistics with travel time and drop |
| fx | GPU particles, decals, tracers, muzzle flash, explosions |
| ai | Skinned soldiers, navmesh pathing, perception, cover behaviour, ragdoll death |
| ui | DOM/CSS HUD: crosshair, hitmarkers, minimap, compass, killfeed |
| audio | Web Audio synthesis — no sound files. Layered weapon fire, convolution reverb, HRTF spatialisation, occlusion |

ARCHITECTURE.md is the contract the agents worked against: subsystem interface,
directory ownership, the cross-subsystem event vocabulary, and shared surface types.

 Tooling

The interesting part of this repo is arguably the harness, not the game.

| tool | purpose |
|---|---|
| tools/capture.mjs | Screenshot one named shot via GPU-backed headless Chromium |
| tools/shotset.mjs | All 11 shots in one session — fast review set |
| tools/baseline.mjs | Reproducible capture: each shot in an isolated page, fixed frame budget. Bit-identical across runs |
| tools/imagediff.mjs | Per-pixel gate. Exits non-zero if any pixel moved |
| tools/profile.mjs | Gameplay pro

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON