← Lab index
THREE.JS / WEBGL RESOURCE LIFECYCLE

Create. Render. Dispose.

A source-backed memory contract: every cycle creates a textured wireframe sphere, renders it through one WebGLRenderer, removes it from the scene, and disposes its geometry, material, and CanvasTexture before the next cycle.

This route claims the installed WebGLRenderer, PerspectiveCamera at z=200, white scene background, per-cycle SphereGeometry + CanvasTexture + MeshBasicMaterial({ wireframe: true }), add/render/remove/dispose ordering, resize, bounded detail controls, sampling, reset, and teardown only. The official source’s Math.random geometry/color stream, exact page/pixel composition, broad device/backend/performance matrices, context-loss/leak stress, and whole-example fidelity remain separate.

Sources: official WebGL memory test · BufferGeometry disposal · Texture disposal