Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Three.js

JavaScript 3D library for creating interactive 3D graphics in browsers.

3D and graphicsNPM

GitHubWebsite

1. License

License from npm.

github.com/mrdoob/three.js

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What Three.js does

Three.js is a general-purpose browser 3D library that ships two renderers, a default WebGL one and a WebGPU one with its own node-based shading language, and it publishes explicit instructions for language models that write code against it.

Three.js popularity

94 / 100
Gid Score, #2 overall
38.1M
downloads a week, npm
119K
GitHub stars
150
agent projects use it
Three.js: downloads per weeknpm, three 38,051,535
Three.js: GitHub starsmrdoob/three.js 119,257

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Three.js is used

  • Three.js is a dependency in 150 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (3.1% of the 4,867 JavaScript/TypeScript ones), #1 of 63 in 3d and graphics.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 3,012; those are left out of every share on this page.
  • The most used alternative in our scan is OGL (16 projects).
  • Projects that use it most often also use Tailwind CSS (80.0%), React Three Fiber (47.3%), Framer Motion (44.0%).
  • It is more common in projects set up for Roo Code (6.3%) than for GitHub Copilot (2.4%).

By coding agent

97 projects, 3.0%
74 projects, 2.4%
68 projects, 2.8%
23 projects, 4.9%
15 projects, 3.2%
13 projects, 4.7%
13 projects, 3.8%
7 projects, 6.3%

Often used with

In 80.0% of its projects
In 47.3% of its projects
In 44.0% of its projects
In 76.0% of its projects
In 56.7% of its projects
In 56.0% of its projects
In 54.0% of its projects
In 72.0% of its projects

Three.js in practice

Strengths

WebGL and WebGPU from one package

Both renderers ship in the main builds. The project's LLM guide says to reach for <code>WebGPURenderer</code> when you need TSL custom materials, compute shaders or node-based materials.

WebGL path is the documented default

The docs describe <code>WebGLRenderer</code> as the mature option, with the widest browser support. They also say most examples and tutorials use it.

TSL shaders run on either backend

TSL builds materials from composable nodes instead of GLSL strings. The docs say the same TSL material works on both the WebGL and WebGPU backends.

Wide addon catalog for file formats

The docs index lists addon exporters for glTF, OBJ, PLY, STL, USDZ, DRACO, EXR and KTX2. They also list a long set of loaders, including GLTFLoader, FBXLoader and DRACOLoader.

Watch out for

Old CDN snippets are out of date

Many copy-paste examples load a fixed old build through a plain <code>&lt;script&gt;</code> tag. The docs mark that pattern as wrong and ask for import maps pointing at the latest version.

WebGPU setup differs from WebGL

The WebGPU renderer comes from a different entry point, <code>three/webgpu</code>. It also needs an awaited <code>init()</code> call before use. WebGL code does not carry over line for line.

Deprecated APIs get removed

Releases are numbered (r187 is the latest listed). Each release links a migration guide section. The r187 notes remove code that was deprecated back in r177, so upgrades can break older code.

Scene, camera and an animated cube

import * as THREE from 'three';

const width = window.innerWidth, height = window.innerHeight;

// init

const camera = new THREE.PerspectiveCamera( 70, width / height, 0.01, 10 );
camera.position.z = 1;

const scene = new THREE.Scene();

const geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 );
const material = new THREE.MeshNormalMaterial();

const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );

const renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setSize( width, height );
renderer.setAnimationLoop( animate );
document.body.appendChild( renderer.domElement );

// animation

function animate( time ) {

	mesh.rotation.x = time / 2000;
	mesh.rotation.y = time / 1000;

	renderer.render( scene, camera );

}

More about Three.js

Funding
  • GitHub Sponsors: https://github.com/mrdoob
  • GitHub Sponsors: https://github.com/HumanInteractive
  • GitHub Sponsors: https://github.com/donmccurdy
  • GitHub Sponsors: https://github.com/WestLangley
  • 27 GitHub sponsors

See all

Agent Skills for it
  • three-best-practices: Three.js performance optimization and best practices guidelines. Use when writing, reviewing, or optimizing Three.js code. Triggers on tasks

See all

Packages around it
  • tailwindcss: Utility-first CSS
  • @react-three: React bindings for Three.js
  • clsx: Class name helper
  • framer-motion: UI animation
  • react: UI library
  • tailwind-merge: Tailwind class merging
More in 3D and graphics

Alternatives

Three.js This page

MITGid 9438.1M/wk

OGL

Lightweight WebGL library for 3D graphics rendering with minimal overhead.

UnlicenseGid 571.2M/wk

Pixi.js

Fast 2D WebGL renderer for interactive graphics, games and animations.

MITGid 652M/wk

Compare Three.js with another tool

Get started

Install it.

npm install three

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Three.js
- In plain HTML, load `three` through an import map pointing at the latest version. Do not use old CDN `&lt;script&gt;` tags such as `r128/three.min.js`.
- Map `three/addons/` as well. Import controls and loaders from it, for example `import { OrbitControls } from 'three/addons/controls/OrbitControls.js';`.
- Default to `WebGLRenderer`. Switch to `WebGPURenderer` only when you need TSL materials, compute shaders or node-based materials.
- For WebGPU, import from `three/webgpu` and `await renderer.init()` before rendering.
- With `WebGPURenderer`, write custom materials in TSL (`three/tsl`), not raw GLSL or `onBeforeCompile` hacks.
- Pair TSL with node materials such as `MeshStandardNodeMaterial` or `MeshPhysicalNodeMaterial`.
- Before upgrading across releases, check the Migration Guide. Recent releases remove code deprecated in earlier ones.

AgentGid articles about Three.js

All guides