JavaScript 3D libraries

Updated Nov 2026

JavaScript 3D libraries draw three-dimensional scenes in the browser through WebGL or WebGPU. On every frame, a renderer draws the scene's camera, lights, and meshes onto a canvas element. These libraries draw the product viewers, globe maps, data visualizations, and browser games on the web.

Popularity

three.js has the most monthly downloads in this comparison, at 133.8M.

LibraryMonthly downloadsStarsLast releaseLicense
three.js
133.8M
118.6KOct 2026MIT
React Three Fiber
35.7M
33.8KOct 2026MIT
regl
5.1M
5.6KNov 2024MIT
ogl
4.4M
4.8KJan 2025Unlicense
@splinetool/runtime
3.0M
Not on GitHubNov 2026Not declared
CesiumJS
1.7M
16.0KNov 2026Apache-2.0
Babylon.js
1.6M
26.4KNov 2026Apache-2.0
PlayCanvas
712.8K
17.3KNov 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Builds general-purpose browser scenes from cameras, geometry, materials, and renderers.

Downloads / mo
133.8M
Stars
118.6K
Last release
0.187.0
License
MIT

Strengths

  • Builds scenes from individual components. Combine cameras, geometry, and materials to create a custom scene.
  • Supports WebGL and WebGPU rendering. Choose the renderer that fits the application and target browser.

Limitations

  • Physics needs an engine integration. Synchronize scene meshes with a separate physics world for simulated collisions.
  • Compressed meshes need a decoder. Attach DRACOLoader before loading Draco-compressed glTF meshes.

Quickstart

From README.md
$ npm install three
import * as THREE from 'three';
const width = window.innerWidth, height = window.innerHeight;
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 );
function animate( time ) {
	mesh.rotation.x = time / 2000;
	mesh.rotation.y = time / 1000;
	renderer.render( scene, camera );
}

three.js examples

From open-source projects on GitHub

React Three Fiber

Renders three.js scenes from React components.

Downloads / mo
35.7M
Stars
33.8K
Last release
9.8.2
License
MIT

Quickstart

From README.md
$ npm install three @react-three/fiber
import React from 'react';
import { Canvas } from '@react-three/fiber';

export default function App() {
  return (
    <Canvas style={{ height: 300 }}>
      <ambientLight intensity={Math.PI / 2} />
      <mesh>
        <boxGeometry args={[1, 1, 1]} />
        <meshStandardMaterial color="orange" />
      </mesh>
    </Canvas>
  );
}

React Three Fiber examples

From open-source projects on GitHub

Replaces the WebGL API with two abstractions: GPU resources and draw commands.

Downloads / mo
5.1M
Stars
5.6K
Last release
2.1.1
License
MIT

Quickstart

From README.md
$ npm install regl
const regl = require('regl')();
const drawTriangle = regl({
  frag: `
    precision mediump float;
    uniform vec4 color;
    void main() {
      gl_FragColor = color;
    }`,
  vert: `
    precision mediump float;
    attribute vec2 position;
    void main() {
      gl_Position = vec4(position, 0, 1);
    }`,
  attributes: {
    position: regl.buffer([[-1, -1], [1, -1], [0, 1]]),
  },
  uniforms: { color: regl.prop('color') },
  count: 3,
});
regl.clear({ color: [0, 0, 0, 1], depth: 1 });
drawTriangle({ color: [1, 0, 0, 1] });

regl examples

From open-source projects on GitHub
function draw() {
  regl.poll();
  regl.clear({color: [0.2, 0.2, 0.2, 1]});
  drawLines([
    {...lineData, phase: 0, color: [1, 0, 0.5]},
    {...lineData, phase: Math.PI, color: [0, 0.5, 1]},
  ]);
}

Provides a small WebGL layer for developers who write their own shaders.

Downloads / mo
4.4M
Stars
4.8K
Last release
1.0.11
License
Unlicense

Quickstart

From README.md
$ npm install ogl
import { Renderer, Camera, Transform, Box, Program, Mesh } from 'ogl';

const renderer = new Renderer();
const gl = renderer.gl;
renderer.setSize(640, 360);
document.body.appendChild(gl.canvas);
const camera = new Camera(gl);
camera.position.z = 5;
camera.perspective({ aspect: gl.canvas.width / gl.canvas.height });
const scene = new Transform();
const geometry = new Box(gl);
const program = new Program(gl, {
  vertex: `
    attribute vec3 position;
    uniform mat4 modelViewMatrix;
    uniform mat4 projectionMatrix;
    void main() {
      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
    }
  `,
  fragment: `
    void main() {
      gl_FragColor = vec4(1.0);
    }
  `,
});
const mesh = new Mesh(gl, { geometry, program });
mesh.setParent(scene);
renderer.render({ scene, camera });

ogl examples

From open-source projects on GitHub

@splinetool/runtime

Loads scenes exported from the Spline editor and renders them in the browser.

Downloads / mo
3.0M
Last release
2.0.194
License
Not declared

Quickstart

From README.md
$ npm install @splinetool/runtime
import { Application } from '@splinetool/runtime';
const canvas = document.getElementById('canvas3d');
const spline = new Application(canvas);
spline.load('https://prod.spline.design/6Wq1Q7YGyM-iab9i/scene.splinecode');

@splinetool/runtime examples

From open-source projects on GitHub

Displays geographic globes and maps with georeferenced models, terrain and interactive camera controls.

Downloads / mo
1.7M
Stars
16.0K
Last release
1.147.0
License
Apache-2.0

Strengths

  • Builds geographic globes and maps. Use a geographic scene for world-scale visualizations.
  • Places models in geographic frames. Transform local model coordinates into the globe’s world coordinate system.

Limitations

  • Local models need a transform. Set modelMatrix to place a local model on the globe.
  • Tutorial assets need a token. Supply a Cesium ion token for the tutorial’s hosted terrain and buildings.

Quickstart

From README.md
$ npm install cesium
import { Viewer } from "cesium";
import "cesium/Build/Cesium/Widgets/widgets.css";
const viewer = new Viewer("cesiumContainer");

CesiumJS examples

From open-source projects on GitHub

Publishes the Babylon.js engine as typed ES modules, with each class importable on its own.

Downloads / mo
1.6M
Stars
26.4K
Last release
9.37.1
License
Apache-2.0

Quickstart

From README.md
$ npm install @babylonjs/core
import { Engine } from "@babylonjs/core/Engines/engine";
import { Scene } from "@babylonjs/core/scene";
import { Vector3 } from "@babylonjs/core/Maths/math.vector";
import { FreeCamera } from "@babylonjs/core/Cameras/freeCamera";
import { HemisphericLight } from "@babylonjs/core/Lights/hemisphericLight";
import { CreateSphere } from "@babylonjs/core/Meshes/Builders/sphereBuilder";
import { CreateGround } from "@babylonjs/core/Meshes/Builders/groundBuilder";
import "@babylonjs/core/Materials/standardMaterial";
const canvas = document.getElementById("renderCanvas") as HTMLCanvasElement;
const engine = new Engine(canvas);
const scene = new Scene(engine);
const camera = new FreeCamera("camera1", new Vector3(0, 5, -10), scene);
camera.setTarget(Vector3.Zero());
camera.attachControl(canvas, true);
const light = new HemisphericLight("light1", new Vector3(0, 1, 0), scene);
light.intensity = 0.7;
const sphere = CreateSphere("sphere1", { segments: 16, diameter: 2 }, scene);
sphere.position.y = 1;
CreateGround("ground1", { width: 6, height: 6, subdivisions: 2 }, scene);
engine.runRenderLoop(() => {
    scene.render();
});

Babylon.js examples

From open-source projects on GitHub

Provides a browser graphics engine with entity components, animation and WebGPU or WebGL rendering.

Downloads / mo
712.8K
Stars
17.3K
Last release
2.24.2
License
MIT

Strengths

  • Runs independently of the Editor. Use the engine directly in a JavaScript application.
  • Blends model animations through states. Use the anim component to play clips and cross-fade between states.

Limitations

  • Physics relies on ammo.js. Load the physics integration when the scene needs rigid-body simulation.
  • Lights start with shadows disabled. Enable shadow casting on lights before expecting objects to cast shadows.

Quickstart

From README.md
$ npm install playcanvas
import * as pc from 'playcanvas';
const canvas = document.createElement('canvas');
document.body.appendChild(canvas);
const device = await pc.createGraphicsDevice(canvas, {
  deviceTypes: [pc.DEVICETYPE_WEBGPU]
});
const options = new pc.AppOptions();
options.graphicsDevice = device;
options.componentSystems = [
  pc.RenderComponentSystem,
  pc.CameraComponentSystem,
  pc.LightComponentSystem
];
const app = new pc.AppBase(canvas);
app.init(options);
app.setCanvasFillMode(pc.FILLMODE_FILL_WINDOW);
app.setCanvasResolution(pc.RESOLUTION_AUTO);
window.addEventListener('resize', () => app.resizeCanvas());
const box = new pc.Entity('cube');
box.addComponent('render', { type: 'box' });
app.root.addChild(box);
const camera = new pc.Entity('camera');
camera.addComponent('camera', { clearColor: new pc.Color(0.1, 0.2, 0.3) });
camera.setPosition(0, 0, 3);
app.root.addChild(camera);
const light = new pc.Entity('light');
light.addComponent('light');
light.setEulerAngles(45, 0, 0);
app.root.addChild(light);
app.on('update', dt => box.rotate(10 * dt, 20 * dt, 30 * dt));
app.start();

PlayCanvas examples

From open-source projects on GitHub

FAQ

three.js composes a scene from separate cameras, geometry, materials, and renderers. Babylon.js is a modular engine whose companion packages supply materials, file loaders, and GUI components.

three.js physics integrations synchronize meshes with a separate physics world. Babylon.js uses external physics engines through plugins. PlayCanvas physics is powered by ammo.js.

three.js GLTFLoader requires a DRACOLoader for Draco-compressed mesh assets.

The PlayCanvas engine runs directly in a standalone application, without the Editor.

PlayCanvas lights start with shadow casting disabled until code enables it.

A model's modelMatrix transforms its local coordinates into Earth's Cartesian world frame.

For coding agents

Found your 3D library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official