Three.js Games: Play the Best WebGL Games & Build Your Own

Three.js is a strong choice for browser games: it gives you direct control over WebGL and WebGPU rendering with a far friendlier API than raw graphics code, a huge ecosystem of loaders and helpers, and a finished game that is instantly playable from a URL, with no install or app store required. Add a physics engine like Cannon.js or Rapier for collision, and React Three Fiber with drei if you want to build in React.

Last updated . Verified against three.js r181.

Read the FAQJump to code

Play Three.js Games in Your Browser

Every game below is a real production Three.js project from the community showcase. Click through to play it, then study how it was built.

Build Your Own Three.js Game

Every game on this page runs on the same open toolchain. Add physics and collision with Cannon.js, skip the React Three Fiber boilerplate with the drei helper library, and tune gameplay values live with Tweakpane or dat.GUI. Need environments? Generate trees procedurally with EZ-Tree and write custom materials with Three.js shaders.

Browse all Three.js tools for the full directory.

Learn Faster with Courses & Boilerplates

Our interactive Three.js courses take you from your first scene to shaders and game loops, with live code you can edit in the browser. Or start from a working project with game-ready boilerplates from the marketplace and get straight to gameplay.

See all learning resources.

See it in production

Browse the full showcase →

Code

Game loop, WebGL (r181)
1import * as THREE from 'three'
2
3const clock = new THREE.Clock()
4const renderer = new THREE.WebGLRenderer({ antialias: true })
5renderer.setSize(innerWidth, innerHeight)
6document.body.appendChild(renderer.domElement)
7
8const scene = new THREE.Scene()
9const camera = new THREE.PerspectiveCamera(60, innerWidth / innerHeight, 0.1, 1000)
10camera.position.set(0, 5, 10)
11
12const player = new THREE.Mesh(new THREE.BoxGeometry(), new THREE.MeshStandardMaterial({ color: 0x4f46e5 }))
13scene.add(player)
14scene.add(new THREE.DirectionalLight(0xffffff, 2).translateZ(5))
15
16function update(delta) {
17 // input, physics step, collision, AI: your game logic lives here
18 player.rotation.y += delta
19}
20
21renderer.setAnimationLoop(() => {
22 update(clock.getDelta())
23 renderer.render(scene, camera)
24})
Instanced enemies, TSL compute (r181)
1import * as THREE from 'three/webgpu'
2import { instancedArray, instanceIndex, deltaTime, Fn, uniform } from 'three/tsl'
3
4// A WebGPU compute shader updating thousands of enemy positions per frame:
5// the kind of GPU-driven simulation that's impractical in plain WebGL.
6const enemyCount = 10000
7const positionBuffer = instancedArray(enemyCount, 'vec3')
8const speed = uniform(2.0)
9
10const updateEnemies = Fn(() => {
11 const pos = positionBuffer.element(instanceIndex)
12 pos.z.subAssign(speed.mul(deltaTime))
13})().compute(enemyCount)
14
15renderer.computeAsync(updateEnemies)

Learn this properly

Learn Practical TSL

Your First Node Material

Start with the TSL for Three.js course to learn the WebGPU/node-material workflow used in GPU-driven game effects.

Start the lesson (6 minutes)

Frequently asked questions

Can you make games with Three.js?

Yes. Three.js is a full 3D rendering library for the browser, and it powers everything from casual arcade games to multiplayer worlds. Combined with a physics engine like Cannon.js and standard browser input events, you can build complete games that run on any device with a modern browser, with no install or app store required.

Is Three.js good for game development?

Three.js is one of the best choices for web-based games. It gives you direct control over WebGL (and WebGPU) rendering with a far friendlier API than raw graphics code, has a huge ecosystem of helpers, loaders, and post-processing effects, and your finished game is instantly playable from a URL. For heavyweight AAA-style projects a dedicated engine like Unity or Unreal may fit better, but for browser games Three.js is hard to beat.

How do I start building a Three.js game?

Start with the core loop: create a scene, camera, and renderer, then update your game state each frame. If you use React, React Three Fiber with the drei helper library removes most of the boilerplate. Add Cannon.js for physics and collision, and a debug UI like Tweakpane or dat.GUI to tune gameplay values live. Our interactive courses and starter boilerplates cover the full setup step by step.

Where can I play Three.js games?

Right here. The games on this page run in your browser, no download needed. Each one is a real production Three.js project from our community showcase, so you can play it, then study how it was built.

Keep reading