Building with Three.js?

Three.js scene leaking memory or shaders refusing to compile? We fix it.

A Three.js scene that looks great on a developer workstation can tank a laptop fan, leak gigabytes on route changes, or refuse to compile a shader on an older iPhone. The library is low level by design, which means every texture, geometry and material you create has to be disposed, every uniform update has to be deliberate, and every shader has to survive the graphics driver of the day. We profile it, dispose it, and ship a scene that runs on the devices you actually sell to.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

three-webgl.log

still leaking

What it is

Three.js at a glance

Three.js is the dominant WebGL library for interactive 3D on the web, created by Ricardo Cabello in 2010 and maintained by a large community of contributors since. It wraps WebGL and now WebGPU with scene graph abstractions like Scene, Camera, Mesh, Geometry, Material and Light, plus loaders for glTF, OBJ, FBX and other common formats.

It is the engine under most 3D product configurators, data visualizations, mapping tools and in-browser games. React-three-fiber brings it into the React model, drei provides a library of helpers, and a healthy ecosystem has grown up around postprocessing, physics, and asset pipelines. By 2026 the WebGPU renderer is production viable on most modern browsers, though WebGL remains the fallback.

Type
JavaScript 3D library for WebGL and WebGPU
First released
2010
License
MIT, permissive
Maintained by
Ricardo Cabello and a wide group of contributors
Typically used for
Product viewers, data visualization, in-browser games, 3D maps, architectural walkthroughs, art pieces

The honest version

Three.js pros and cons

No technology is all upside. This is where Three.js earns its place and where it tends to cause trouble.

Where Three.js is strong

  • The most mature WebGL ecosystemYears of community work means loaders, postprocessing, physics, animation and VR tooling already exist. Picking a less popular library in 2026 means building many of these yourself.
  • React-three-fiber is a strong abstractionFor React apps, R3F turns the scene graph into components that compose with the rest of the UI, which makes 3D feel like another part of the codebase rather than a separate island.
  • WebGPU renderer is landingThe WebGPU backend brings significant performance improvements, compute shaders, and better driver reliability. It works alongside the WebGL path during the transition.
  • glTF pipeline is excellentImporting a glTF or GLB from Blender, Cinema 4D or a pipeline tool usually just works, including PBR materials, skeletal animation, and morph targets.
  • Postprocessing and shaders are first classCustom GLSL, shader chunks, and effect composition let you reach for the kind of visual polish that used to be the preserve of native game engines.
  • Huge community, huge examplesThe threejs.org examples page and the R3F community cover almost every pattern you will reach for, which cuts the research time on any new technique.

Where Three.js bites

  • Memory management is manualGeometries, materials and textures all hold GPU resources that you have to dispose yourself when a scene unmounts. Forgetting to do so is the most common source of long sessions eating gigabytes.
  • Shader errors vary by deviceA GLSL shader that compiles on your desktop can fail on an older iPhone, a mobile Android chipset or a corporate VDI. The fallback path and precision qualifiers need thought.
  • Context loss is a real eventA tab backgrounded for too long, a driver crash or a GPU hog in another tab can lose the WebGL context without warning, taking the scene with it. Recovery has to be built, not assumed.
  • Performance is on the author, not the libraryDraw calls, overdraw, texture sizes, instancing and frustum culling all matter. A naive scene with twenty materials and a thousand meshes will run badly no matter how modern the hardware is.
  • Breaking changes between revisionsThree.js ships major revisions frequently and breaks APIs on the way. Upgrading a project that is two years out of date usually involves rewriting materials, loaders, and sometimes the render loop.
  • Steep learning curve for the GPU halfScene graphs are approachable. Writing a custom shader, debugging a transform matrix, or tracing a rendering artifact back to UV coordinates is a very different skill than React development.

Sound familiar?

Common Three.js problems we fix

The Three.js problems that bring people to us, and what you have once each one is fixed.

THREE.Texture dispose() never called

Memory climbs on every route change

Textures, geometries and materials created inside a page component but never disposed when the component unmounts. GPU memory grows until the tab crashes, and the symptom is always worse on mobile.

Resources disposed on unmount

THREE.WebGLProgram: Shader Error - FRAGMENT SHADER

Shader compiles on desktop, fails on mobile

Precision qualifiers missing, a GLSL extension required that mobile does not have, or a built-in function name that changed between GLSL versions. The desktop driver was forgiving, the mobile one is not.

Shaders cross-compile cleanly

THREE.WebGLRenderer: Context Lost

The canvas goes black and stays black

A WebGL context loss event that was never listened for, so the scene renders to a context that no longer exists. Modern browsers lose context more often than people realize, especially on laptops with hybrid GPUs.

Context recovered on loss

Draw calls: 4,812 · Triangles: 2.1M

Framerate drops to single digits

Thousands of draw calls from individual meshes instead of instancing, materials created per frame, or textures larger than the screen will ever show. The usual fix is batching and resizing before it is a lighting trick.

Frame budget back under 16 ms

WebGPU: validation error: binding group layout mismatch

WebGPU renderer crashes on some devices

A pipeline that assumes a binding layout one driver accepts and another rejects, or a feature that requires a device flag that is not enabled on a Chrome version in the wild.

WebGPU path safe across drivers

THREE.BufferGeometry.computeBoundingSphere(): NaN

Models appear invisible or in the wrong place

A geometry whose attributes contain NaN values after a procedural step, or a transform matrix that went singular, so the bounding sphere is garbage and frustum culling hides everything.

Geometry attributes validated

THREE.WebGLRenderer: image is not power of two

Textures look blurry or mip-less

A loaded texture with non-POT dimensions on a target that needed POT for mipmapping. Three resizes it, which can produce the blur the designer is complaining about.

Texture pipeline matches target

Hydration mismatch: canvas rendered differently on server

Next.js SSR fights the canvas

A Three.js canvas rendered in a server component without a client boundary, which React tries to hydrate and tears out immediately. The fix is always to move the Canvas into a client component.

Canvas lives on the client only

What we do

Three.js help, from one leaking scene to the whole render pipeline

Call us for one shader that will not compile, or hand us the whole 3D pipeline.

Rescue
Leaking scenes, broken shaders, context losses on mobile, or a product viewer that crashes on real hardware. We stabilize, then refactor.
Performance tuning
Draw call batching, instancing, material sharing, texture compression and LOD strategies against your actual target devices and target framerate.
Asset pipeline
glTF export rules from Blender or Cinema 4D, Draco compression, KTX2 textures and a reproducible build step so artists are not blocked by the engineering team.
React-three-fiber integration
Scene graph as React components, hooks that respect the render loop, and a project layout that keeps the UI and the 3D in the same codebase without fighting each other.
WebGPU migration
Moving the renderer path to WebGPU with a WebGL fallback that still works, including feature detection and compute shader integration where it earns its keep.
Managed Tech
Ongoing profiling against real devices, three.js revision upgrades planned on a cadence, and support when a browser update breaks a shader that was fine yesterday.

How it works

From first message to fixed

  1. Look Free estimate

    Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.

  2. Fix

    We fix the cause, not the symptom. If something is down, getting it back up comes first.

  3. Harden

    Backups, monitoring, updates and access, so the same problem can't quietly come back.

  4. Hand back or stay on

    You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.

Often found together

Running Three.js alongside something else?

We work on the whole stack, so the problem can be wherever it actually is.

Questions

Three.js questions

Something else? Call+1 737 727 7327

Why does our Three.js app eat memory over time?

Almost always undisposed resources. Every Geometry, Material, Texture and RenderTarget holds GPU memory that is not released by garbage collection; you have to call dispose on them when the scene or component goes away. We audit the lifecycle and add a disposal strategy that matches the routing model.

Our scene runs fine on desktop and terribly on mobile, what's the usual cause?

Three things: textures that are too large, shaders that use precision or features mobile drivers do not love, and a frame budget assumed to be sixteen milliseconds when the device gives you less. Profiling on an actual phone rather than a throttled desktop is the first step.

Should we use Three.js directly or react-three-fiber?

For a React app, R3F is almost always worth it. The scene graph becomes components, hooks compose with the rest of the app, and the drei library covers most of the boilerplate. Vanilla Three.js still makes sense for a standalone scene or a non-React host like a game loop.

Is WebGPU ready for production in 2026?

On modern desktop Chrome, Edge and Firefox the answer is yes with caveats. Safari support is coming along. Most teams ship both paths: WebGPU where available, WebGL fallback for everyone else. The compute shader and performance wins from WebGPU are real but not free to adopt.

How do we debug a shader that compiles sometimes and fails others?

Pin down the device, then isolate the shader with the simplest possible test. Precision qualifiers, texture2D versus texture, varying versus in/out and extension directives are the usual culprits. We keep a device matrix and a shader test harness for exactly this class of bug.

How much does Three.js help cost?

The first review is free. Tell us what the scene is doing, the devices it has to run on, and we come back with a price before any work is scheduled.

Free estimate

Three.js giving you trouble?

Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.

  • No charge to find out what it will take
  • If it's urgent, say so

Replies come from a person. By sending, you authorize us to email you back. No marketing.