DESCENT is a Three.js/TypeScript cel-shaded downhill BMX racing game in which every asset is generated by code and the physics/render pipeline is engineered for stylized visuals and deterministic capture.

Stars

23

7-day growth

No data

Forks

7

Open issues

0

License

No data

Last updated

2026-08-01

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It shows how a complete game can be built without any external models, textures, fonts, or audio, while also demonstrating a structurally enforced NPR rendering pipeline, procedurally eroded terrain, and a deterministic review harness.

Who it is for

  • Developers building Three.js/WebGL games
  • Technical artists interested in cel shading and non-photorealistic rendering
  • Procedural generation and terrain simulation enthusiasts
  • BMX/sports game players and indie game fans

Use cases

  • Reference implementation for cel-shading and NPR pipelines in WebGL
  • Learning how to generate a full asset set procedurally from code
  • Prototyping a physics-driven racing game with fixed-timestep simulation
  • Using deterministic browser captures for visual regression and animation review

Strengths

  • Every asset is code-generated: geometry, textures, fonts, audio, and terrain all come from the repository itself
  • The NPR pipeline is enforced structurally: no PBR materials, quantized lighting, chromatic shadows, dual line systems, and variable line weight
  • The terrain uses droplet-based hydraulic erosion plus thermal erosion, with a corridor prior so the course is carved into the landscape
  • The engineering is robust: fixed 120Hz physics, adaptive resolution governor, interface-driven contracts, zero-allocation hot paths, and a deterministic capture harness

Considerations

  • The 60fps retina target is tied to high-end hardware such as an M5 Pro in Chrome, so lower-end devices may struggle
  • The control scheme is complex, with many keyboard modifiers and technique-heavy mechanics that have a steep learning curve
  • Because all assets are generated by code, changing art content requires modifying code or regenerating assets rather than replacing files directly

README quick start

DESCENT

A cel-shaded downhill BMX racing game. Four riders, point to point, summit to valley floor. Built in Three.js and TypeScript.

Every asset in this repository is generated by the code in this repository. No downloaded models, textures, HDRIs, fonts, or audio. Every mesh is built from geometry primitives and procedural lathes in code. Every texture is rasterised with canvas 2D or evaluated in a shader. Every sound is synthesized with the Web Audio API. The mountain is noise plus a hydraulic erosion simulation. The letterforms in the HUD are drawn as paths.

npm install
npm run dev

That is the whole setup. Open the URL it prints and you are racing.


Controls

W / Pedal
A D / Steer
S / Rear brake — locks the back wheel, scrubs speed, throws dirt
QFront brake
SpaceCrouch → preload. Hold into a lip, release at the top for extra air. Also bunny-hops on flat ground.
J / KLean back / forward. Lean back on the flat to manual.
Shift + directionTrick modifier 1 (tailwhip, x-up)
E + directionTrick modifier 2 (superman, tabletop)
FBoost — spends the meter you filled with tricks
RReset to the last checkpoint
CLook back
VCycle camera
EscPause
`Debug overlay

A standard gamepad works too; the left stick bypasses the keyboard's input smoothing.

The one mechanic worth learning: preload and pump. Hold crouch on the approach to a lip and release it at the lip. Time it well and you leave the ground with substantially more vertical velocity than the ramp gave you. Release early and you go flat. There is a ~140ms window and it is the skill ceiling of the whole game.


Art direction

One committed palette: dawn-gold alpine. A low sun at 21.5° raking across the mountain from the east-southeast, cool violet-slate shadows, and a teal-shifted haze stacking the far ridges into flat paper layers. Every colour in the game is declared in src/npr/Palette.ts and nowhere else.

Three rules the code enforces structurally, not by convention:

  1. There is no PBR to leak in. There is no MeshStandardMaterial anywhere in the project and no code path that could construct one. Every surface is a CelMaterial built from a RampPreset.

Related repositories

Similar projects matched by category, topics, and programming language.

TanStack
Featured
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web DevelopmentFrontend Frameworks
14,861
vercel-labs
Featured
vercel-labs GitHub avatar

scriptc

scriptc compiles ordinary TypeScript into small, fast native executables without needing Node.js, V8, or any JavaScript runtime in the binary.

Developer ToolsCode Quality & Build
1,985
bashalarmistalt
Featured
bashalarmistalt GitHub avatar

decimen-optical-transfer

A proof-of-concept that transfers files between two devices using only a screen and camera by encoding data as an endless stream of animated QR codes with fountain coding to handle dropped frames.

TypeScript
1,960