Every concept in Three.js explained visually. 96 illustrated breakdowns covering geometry, materials, cameras, shaders, post-processing, physics, audio and more. No prior 3D experience required - just scroll.
All 96 slides in sequence - 7 minutes covering every Three.js concept from geometry to shaders.
Three.js is a JavaScript library that wraps WebGL (and now WebGPU) into an approachable scene graph API. The core idea: you describe what you want to show - objects, lights, a camera - and the renderer figures out how to draw it on the GPU. The architecture is simple: a Scene holds Object3Ds, a Camera defines the view, and a Renderer draws it all every frame.
Geometry defines the shape of a 3D object - the vertices, edges and faces that make up its surface. Under the hood, everything is a BufferGeometry: flat typed arrays of vertex data (position, normal, UV, color, index) sent directly to the GPU. Three.js ships 21 built-in geometry constructors, plus the tools to create your own from scratch or load from files.
Materials control how geometry looks when rendered - its colour, shininess, transparency, and how it reacts to light. Three.js has materials for every use case and performance budget: from the cheapest flat MeshBasicMaterial (no lighting) to the fully physics-based MeshPhysicalMaterial with clearcoat, sheen, iridescence, transmission and subsurface scattering. The right material makes the difference between flat and photorealistic.
Lighting is what makes a 3D scene feel real. A well-lit scene communicates depth, weight, material type and mood. Three.js offers 7 light types - from the ambient fill that eliminates harsh shadows to the precise spotlight casting dramatic shadows. Only DirectionalLight, SpotLight and PointLight can cast shadows; each uses a shadow map technique (rendering the scene from the light's POV to determine occlusion).
Everything in a Three.js scene is an Object3D - the base class providing position, rotation, scale, visibility, and parent/child hierarchy. From the basic Mesh to the GPU-instanced InstancedMesh that draws 100,000 copies in a single draw call, each object type exists to solve a specific rendering challenge.
The camera defines how the 3D scene is projected onto your 2D screen. PerspectiveCamera mimics human vision - objects farther away appear smaller. OrthographicCamera has no perspective - objects stay the same size regardless of distance, giving the classic isometric game look. The remaining cameras serve specialised purposes: real-time reflections, multi-viewport, and VR.
Textures are images mapped onto geometry surfaces to add visual detail without adding geometry. A UV map on each vertex tells the GPU which part of the texture to sample there. Three.js supports flat colour textures, normal maps for fake surface depth, full PBR texture sets, video textures, HDR environments, and compressed GPU-native formats for 4–8× less VRAM usage.
The renderer transforms your scene into pixels. Three.js has WebGLRenderer (the proven standard, works everywhere) and WebGPURenderer (the modern future, compute shaders, better performance). Both share a common abstraction layer so most code runs on either. Key features: shadow maps, environment mapping, tone mapping, anti-aliasing, and render targets for off-screen rendering.
Post-processing applies screen-space effects after the scene is rendered to a texture. EffectComposer chains passes together - the output of one feeds into the next. Three.js ships 20+ built-in passes and you can write custom fullscreen shader passes. The difference between a raw render and a cinematic scene is almost entirely post-processing.
Controls translate user input (mouse, keyboard, touch, gamepad) into camera or object movement. Three.js ships 8+ control types in the addons (jsm/controls/). The right choice depends entirely on the use case - don't use OrbitControls for an FPS game, don't use PointerLockControls for a 3D product viewer.
TSL is Three.js's shader authoring system written entirely in JavaScript. Instead of writing GLSL strings, you compose shader graphs from function nodes - color(), texture(), add(), normalMap(), noise() - and TSL compiles them to GLSL for WebGL or WGSL for WebGPU automatically. No raw shader strings, no manual uniform management, no platform-specific code.
Three.js includes a complete keyframe animation system. AnimationClip stores named tracks of keyframed values. AnimationMixer plays clips on an object, handling speed, looping, blending and crossfading between multiple clips. Used for everything from a spinning cube to fully rigged character animation.
Three.js integrates the Web Audio API into the scene graph. AudioListener attaches to the camera and acts as the player's ears. PositionalAudio attaches to 3D objects and automatically adjusts volume and stereo panning based on distance and angle from the listener - walk towards an explosion and it gets louder, walk past it and it pans side to side.
Three.js addons include high-level pre-built objects for visual needs that would take weeks to build from scratch - animated ocean water, procedural sky, real-time mirror reflections, lens flares, HTML elements in 3D space, and GPU-instanced forests. All in jsm/objects/ and ready to drop into any scene.
Loaders import external assets - 3D models, textures, environments. Three.js ships a base Loader class and dozens of format-specific loaders in the addons. Use GLTFLoader for 3D models - it's the "JPEG of 3D", compact and feature-complete. Use LoadingManager to track combined loading progress across all assets.
Three.js has no built-in physics - it's a rendering library. But it pairs seamlessly with dedicated physics engines. The pattern is always the same: physics world runs the simulation, Three.js mirrors the results visually. Popular choices: Rapier (Rust/WASM, fastest, deterministic), cannon-es (pure JS, easy), Ammo.js (Bullet port, full-featured), Jolt (game-quality).
Helpers are Object3D instances added to the scene during development to visualise invisible things - camera frustums, light shapes, bone positions, bounding boxes, normals. They are standard scene objects: add them, move them, set visible=false. Remove before shipping. Invaluable for debugging shadow cameras, verifying rig setup, checking frustum culling.
Three.js has a rich 2D/3D curve and shape system. Curves define smooth paths through space - use them for camera fly-throughs, tube geometry, spline animation. Shapes define 2D outlines that can be extruded into 3D. PMREMGenerator is the utility that makes physically-based environment lighting work correctly.
Three.js includes a complete 3D math library. These classes are used everywhere in the engine and in your code - setting positions, composing rotations, computing transforms, building ray queries. Understanding Vector3, Quaternion and Matrix4 deeply is fundamental to working with Three.js beyond the basics.


















































































