What Has Changed Since the Older WebGL and three.js Guides

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The ideas in the three older WebGL books are still sound: a scene graph of objects, cameras that project it, geometry that becomes buffers, materials and lights that become shaders, textures, picking with a ray, animation as keyframes, and a render loop. What has changed is almost everything that is typed: class names, loader names, the way a script is included, the colour rules, the browser support and the format used to bring a model into the page. The books were written for three.js revisions r49 to r69 (2012 to 2015) and for WebGL 1 only; this sub-section documents r187 (npm three@0.187.0, 30 October 2026), WebGL 2 and WebGPU. This page lists, book by book, the statements that are out of date and what to do today, so that you can keep reading the books for their explanations and use the pages of this sub-section for current code. The facts were checked in November 2026 against the three.js Migration Guide and release notes, the three.js manual and the WebGL specifications. For the changes that affect all graphics libraries, not only WebGL, see What Has Changed Since the Older Guides.

The books are listed in the section bibliography and have the short names used in the tables: PAR (Tony Parisi, WebGL: Up and Running, 2012), LTJ (Jos Dirksen, Learning Three.js, 2nd edition, 2015) and TCB (Jos Dirksen, Three.js Cookbook, 2015). Chapter numbers are those of the books. The revision numbers in the Revision column are three.js release numbers, so r125 is the release that removed the item, and the Migration Guide is the primary source for each.

Two panels, a global script with CubeGeometry, ImageUtils, MeshFaceMaterial, Projector and CanvasRenderer on the left, and ES module code with BoxGeometry, TextureLoader, a material array and Raycaster on the right
Figure 1. The same spinning cube as a 2013 book writes it and as it is written in r187

The left panel is the style of all three books; the right panel is the structure of three.js: Getting Started. None of the names in the left panel exists in r187, and a program copied from a book fails on the first line that uses one of them.

The corrections, book by book

PAR: WebGL: Up and Running (2012)

Chapters What the book says What is current Revision or date Read more

7

Internet Explorer has no WebGL, Safari needs a developer toggle and iOS supports WebGL only inside iAd.

WebGL 2 runs in every evergreen browser (Chrome 56, Firefox 51, Edge 79, Safari and iOS 15), about 97 percent of global usage in November 2026. Internet Explorer is retired.

2017 and 2021

WebGL Versions and Browser Support

1 and 7

The context is requested with "experimental-webgl", animation uses a vendor-prefixed requestAnimationFrame and Detector.js tests for support.

Ask for getContext("webgl2") and fall back only if you must. In three.js drive the loop with renderer.setAnimationLoop. Detector.js was replaced by the WebGL compatibility module.

r97 and r107

Your First Triangle in WebGL 2, WebGL Versions and Browser Support

3

Geometry is built from THREE.Geometry, Face3 and CubeGeometry, and the scene is described with Sim.js.

BoxGeometry and the other primitives are BufferGeometry subclasses. Geometry was removed in r125 and Face3 in r126. Sim.js is not needed: the scene graph and the examples' lil-gui cover its role.

r66, r125 and r126

three.js Geometry, three.js Scene Graph and Transforms

5

Picking converts the mouse position with THREE.Projector and an unprojected vector.

Convert the pointer to normalised device coordinates and call Raycaster.setFromCamera. For many objects consider GPU colour-ID picking.

Since the 2010s

three.js Interaction, Picking and Controls

7

Models are loaded from the three.js JSON format, from COLLADA or from the binary format produced by the Blender exporter.

Use glTF 2.0 (.glb or .gltf) with GLTFLoader and Blender’s glTF exporter. The legacy three.js loaders were removed between r97 and r111, and COLLADA is no longer the recommended exchange format.

r97 to r111

Loading Models and glTF in three.js

3

Shaders are GLSL ES 1.00 with attribute, varying and gl_FragColor.

WebGL 2 shaders start with #version 300 es and use in, out and a declared fragment output. In three.js set glslVersion: THREE.GLSL3 on the material.

WebGL 2 (2017)

GLSL ES 1.00 and 3.00 in WebGL, three.js Custom Shaders (GLSL)

3 and 8

Particle systems are built from the early three.js particle classes and a list of vertices, and sound uses a custom audio helper.

Use Points with PointsMaterial, instancing or transform feedback for GPU particles, and the three.js Audio classes or the Web Audio API for sound.

r72 for Points

three.js Geometry, WebGL 2 Advanced Features

4

Animation is done with Tween.js tweens.

Tween.js still works for UI-style tweens, but model animation uses AnimationMixer, clips and actions, with the Timer class replacing Clock.

r86 and r183

three.js Animation System

LTJ: Learning Three.js, 2nd edition (2015)

Chapters What the book says What is current Revision or date Read more

1

Development uses the IEWebGL plugin for Internet Explorer and disables the browser’s security checks to open pages from file://.

Serve the page from a development server such as Vite, or use an import map with any static server. Textures from file:// are blocked by design.

ES modules since r137

three.js: Getting Started, WebGL Security, CORS and Privacy

2 to 6

THREE.Geometry, Face3 and CubeGeometry describe shapes, and textures come from THREE.ImageUtils.loadTexture.

Only BufferGeometry remains, and TextureLoader loads images.

r66, r89, r125 and r126

three.js Geometry, three.js Textures and Colour Management

3

AreaLight and the core LensFlare object light and decorate a scene, and light intensities are unitless numbers.

RectAreaLight replaces AreaLight, the lens flare is the Lensflare addon, light intensities use physical units (candela, lux and lumens) and point and spot lights have decay = 2.

r90, r147 and r155

three.js Lights and Shadows

3 and 4

Shadows are enabled with renderer.shadowMapEnabled and sized with light.shadowMapWidth.

Use renderer.shadowMap.enabled, light.shadow.mapSize and shadow.bias. PCFSoftShadowMap is deprecated since r182.

r72 and r74

three.js Lights and Shadows

4

One object uses several materials through MeshFaceMaterial (or MultiMaterial).

Pass an array of materials and give the geometry groups.

r85

three.js Geometry, three.js Materials and PBR

7

PointCloud and PointCloudMaterial draw particles, and CanvasRenderer is the fallback for browsers without WebGL.

Points and PointsMaterial. CanvasRenderer was removed in r98 and every supported browser has WebGL 2.

r72 and r98

three.js Geometry

8

CTM, AWD, Babylon and AssimpJSON loaders import models.

These loaders were removed. Convert the asset to glTF 2.0.

r108 to r110

Loading Models and glTF in three.js

9

MorphAnimMesh, THREE.Animation and AnimationHandler play animations, and materials need the morphTargets and skinning flags.

AnimationMixer with clips and actions plays every animation, and the material flags were removed.

r86 and r129 to r130

three.js Animation System

11

Post-processing with EffectComposer is the only path.

It is still valid with WebGLRenderer, now ending with OutputPass for tone mapping and colour conversion. WebGPURenderer uses RenderPipeline instead.

RenderPipeline r183

three.js Post-processing, three.js WebGPURenderer and TSL

12

Physijs, an unmaintained wrapper around Ammo.js and cannon.js, adds physics, and dat.GUI builds control panels.

Choose a current engine from the physics page of the three.js manual and the general Physics, Audio and Input Basics. The examples bundle lil-gui in place of dat.GUI.

Since the late 2010s

three.js Animation System

TCB: Three.js Cookbook (2015)

Chapters What the book says What is current Revision or date Read more

1

Detector.js and the "experimental-webgl" context name decide whether WebGL is available, and a local web server is optional.

Call getContext("webgl2") or catch the renderer constructor error, and always use a development server.

r97 and r107

WebGL Versions and Browser Support, three.js: Getting Started

1, 2 and 7

The three.js exporters and loaders for JSON, OBJ with OBJMTLLoader and Collada bring models in.

Export glTF 2.0 from Blender. For OBJ, MTLLoader and OBJLoader replace OBJMTLLoader, and both are legacy formats today.

r97 to r111

Loading Models and glTF in three.js

1 and 3

Picking uses THREE.Projector and mouse events, and the camera controls are loaded as global scripts from examples/js.

Raycaster.setFromCamera with pointer events, and controls imported from three/addons/. The examples/js folder was removed in r148.

r148

three.js Interaction, Picking and Controls

4

MeshFaceMaterial combines materials, and light and material values are tuned in a gamma-unaware workflow with renderer.gammaInput and gammaOutput.

Material arrays, renderer.outputColorSpace = THREE.SRGBColorSpace, ColorManagement.enabled (the default since r152) and texture.colorSpace. Book lighting values look different today.

r85, r152 and r155

three.js Materials and PBR, three.js Textures and Colour Management

5

Custom shader recipes use GLSL ES 1.00 with the built-in ShaderMaterial uniforms.

The recipes still work with WebGLRenderer, and GLSL 3.00 is available with glslVersion: THREE.GLSL3. ShaderMaterial does not work with WebGPURenderer, which uses TSL.

r163 for WebGL 1 removal

three.js Custom Shaders (GLSL), three.js WebGPURenderer and TSL

6

PointCloud particles and the composer’s post-processing passes add effects.

Points, and the EffectComposer with OutputPass on WebGLRenderer or RenderPipeline on WebGPURenderer.

r72 and r183

three.js Post-processing, three.js Geometry

7

Animation uses MorphAnimMesh and skinned meshes with the THREE.Animation class, and Physijs adds physics.

AnimationMixer, and a maintained physics engine chosen from the three.js manual.

r86 and r129

three.js Animation System

All three books

What the books say What is current Revision or date Read more

Every example is a global <script> that loads three.min.js and files from examples/js.

ES modules: import * as THREE from "three" with three/addons/ for the add-ons, resolved by Vite or by an import map. The examples/js folder was removed in r148.

r137 and r148

three.js: Getting Started

Colours and lights are defined in a gamma-unaware way and the renderer shows them unchanged.

The renderer converts from a linear working space to SRGBColorSpace on output. Colour textures need texture.colorSpace = SRGBColorSpace, and data textures stay linear.

r152

three.js Textures and Colour Management, Lighting in WebGL Shaders

Only GLSL ES 1.00 and WebGL 1 exist.

WebGL 2 with GLSL ES 3.00 is the baseline, WebGLRenderer has not supported WebGL 1 since r163, and WebGPU is the successor API.

2017 and r163

WebGL Versions and Browser Support, WebGPU: Overview and Comparison with WebGL

THREE.Geometry, Face3 and CubeGeometry are the geometry classes.

BufferGeometry only, with BoxGeometry for the cube.

r66, r125 and r126

three.js Geometry

THREE.ImageUtils.loadTexture loads textures.

TextureLoader, which returns the texture immediately and fills it when the image arrives.

removed in r89

three.js Textures and Colour Management

Raw WebGL examples need no context-loss handling and no cross-origin rules.

A context can be lost at any time, and cross-origin images need CORS headers and crossOrigin before they can be textures.

Always

Context Loss and Robustness, WebGL Security, CORS and Privacy

Seven rows mapping old names to current ones: CubeGeometry to BoxGeometry, ImageUtils to TextureLoader, MeshFaceMaterial to material arrays, Projector to Raycaster, PointCloud to Points, CanvasRenderer removed in r98, and gamma settings to colour management
Figure 2. The three.js names of the books and their current forms
Dot plot of three.js revisions from r66 to r183, with BoxGeometry, shadowMap.enabled, Points, material arrays, AnimationMixer, TextureLoader, no CanvasRenderer, glTF loaders, no Geometry or Face3, ES modules, colour management, physical lights, no WebGL 1 in WebGLRenderer and RenderPipeline
Figure 3. The three.js revisions behind the corrections

A dot far to the right of the shaded area means the book code may still have run for years; a dot inside or near it means it broke quickly. Both groups need the same cure: replace the removed name with the one on the right of the tables above.

What to keep from the books

  • The explanations of the scene graph, of cameras and projection, of texture mapping, of lighting models, of picking with a ray and of keyframe animation remain correct. Only the names of the calls around them have changed.

  • The structure of the book projects (create a scene, a camera and a renderer, add objects, run a render loop) is exactly the structure of three.js: Getting Started.

  • The raw WebGL chapters of PAR still describe the pipeline well; read them together with The WebGL Rendering Pipeline and use WebGL 2 for the code.

  • Where a book and the three.js manual or the Migration Guide disagree, follow the manual and the Migration Guide.

Two columns: keep the scene graph, texture mapping, picking, keyframes and the render loop structure; replace class names, global scripts, the gamma-unaware workflow, WebGL 1 code and the three.js JSON model format
Figure 4. What still holds in the books and what does not

See also

References