# debuff vs three.js

three.js is the most popular 3D library on the web. People also use it for 2D games, because it's familiar and well documented. debuff is a framework made for 2D browser games. Here's how they compare as of October 2026.

## Short answer

Pick **three.js** for 3D, or for 2D that leans on shaders, lighting or 3D effects. Pick **debuff** for a 2D game where you want a game loop, input, audio, tests and agent tooling included, in a much smaller runtime.

## At a glance

| | debuff 0.20 | three.js r186 |
| --- | --- | --- |
| License | MIT | MIT |
| Language | TypeScript | JavaScript, with TypeScript types |
| What it is | 2D game framework | 3D rendering library ([threejs.org](https://threejs.org/)) |
| Game loop, input, audio, scenes | Built in | Bring your own |
| Physics | Tile collision | Bring your own |
| Full runtime, brotli | 30 kB (every debuff package) | 151 kB (`three.module.js`, minified) |
| Testing | Scenarios, screenshot baselines, fuzz | Up to you; [Keiko](./introducing-keiko) runs three.js games in Node on a virtual clock |
| Profiling | Dev overlay frame graph; [Myaku](./introducing-myaku) | [Myaku](./introducing-myaku) works with three.js too |
| Coding agents | MCP server for the running game, `AGENTS.md`, llms.txt | [llms.txt](https://threejs.org/llms.txt); no official MCP server found |
| Community | Small | Huge (about 117k GitHub stars), large examples gallery |

## Where three.js is stronger

- **3D.** Scenes, cameras, materials, lighting, shadows, glTF and post-processing.
- **Examples.** A huge gallery of live examples with source, which helps humans and agents alike.
- **Ecosystem.** Countless add-ons, tutorials and frameworks built on top of it.
- **Agent docs.** three.js publishes an llms.txt.

## Where debuff is different

- **A game framework, not a renderer.** Fixed-step loop, input bindings, audio, tilemaps, tweens and particles are included.
- **Size.** The whole debuff runtime is a fraction of three.js's core, before you've added any game code.
- **Tests and fuzzing.** Fixed steps and a seeded RNG make scenarios, exact replays and fuzzing possible.
- **An agent on the running game.** debuff's MCP server attaches to the game you have open, reads moments you flag, replays them and tunes typed params you can undo. See the [agent comparison](./coding-agents-and-browser-game-engines).
- **Tools that also work with three.js.** [Keiko](./introducing-keiko) runs a web game in Node on a virtual clock, so timing and rules tests finish in milliseconds. [Myaku](./introducing-myaku) finds the frames players feel drop and names the cause, including the [shader-compile stutter](./three-js-frame-drops-shader-compile-stutter) common in three.js games. Both are MIT and work with three.js, so you can use them even if you stay with it.

## Which to choose

If your game is 3D or needs 3D rendering, use three.js. If it's 2D, you'll be writing a game engine on top of a 3D library. Try debuff instead:

```bash
npm create debuff@latest my-game
```