Published on
//

Building a Lava Lamp with Blender MCP and Three.js

A lava lamp is a useful little graphics problem: a solid housing, transparent glass, and wax that stretches, joins, and separates. This proof of concept combines a model built through Blender MCP with a live Three.js scene.

Try changing the wax and liquid colours, slowing the flow, or turning down the glow. Drag the lamp to look around it.

Warming up the lamp…
Drag to orbit · scroll to zoom · arrow keys to rotate

Modeling the housing through Blender MCP

I used MCP for Blender to send Python modeling commands into Blender. The base, cap, collars, glass shell, and bulb were built from radial profiles: revolve a sequence of radius and height pairs around an axis to make each surface. The glass has separate inner and outer walls.

Fine grooves are modeled into the black metal surfaces. A separate liquid volume and a curved power lead complete the asset. Those eight meshes were exported together as a GLB. Blender handles the asset creation; the browser loads the resulting model. The finished page does not need a running Blender instance or an MCP connection.

Giving the wax a shared surface

The wax is generated in Three.js with MarchingCubes. Each moving blob contributes to a scalar field. Nearby contributions combine, and the renderer extracts a surface at a chosen threshold. This lets blobs join into a continuous shape and split apart as their positions change.

The reservoir at the bottom contributes to that same field. Smaller trailing lobes help form stretching necks. The rise-and-fall paths are deliberately choreographed: this is a visual approximation, not a simulation of temperature, fluid pressure, or conserved wax volume.

Bringing it into the article

Three.js adds liquid transmission, glass reflections, a warm bulb, and a restrained bloom effect. The liquid provides the refraction, while a thin reflective shell supplies the glass highlights. This keeps the POC to a single refractive layer. A small shader adjustment gives the wax a vertical colour gradient. The controls update material colours, emission, and animation speed directly.

The lamp's graphics code loads when it approaches the viewport, pauses when it leaves the screen or the tab is hidden, and releases its GPU resources when readers leave the article. Reduced-motion preferences start it paused; readers can choose to play it.