Content, images, and animation copyright © 1997–2026 Peter C. Miller.
At several points in my career, while testing 3D software and GPU hardware, I needed a polygonal model that could grow in density on demand. The Menger sponge fits that need: each iteration adds a predictable jump in complexity. I wrote several MEL and Python scripts for this, using different methods — subtractive booleans, additive construction, and simple replacement — to build sponges of different depths.
Anyone who works in 3D knows the efficient way to render a Menger sponge is a custom shader, not a pile of polygons. If the goal is frame rate, the geometric approach below looks wasteful. That is not the goal here. These models exist to stress workstations and graphics cards — to find practical limits. For that, a linear, geometry-based sponge still works very well.
I did not want waste for its own sake, though. A casually built sponge often keeps hidden internal faces that tax both GPUs and software renderers. It also tends to carry duplicated vertices, which most 3D applications can weld out.
The snapshots below show the problem.
Menger sponge level 1:
The same sponge in X-ray display:
Same sponge, with unneeded internal surfaces in orange:
A clean level-1 sponge with those faces removed. Only 24 surfaces come off at this level — not much, but the savings grow quickly:
Level 2 with duplicated internal surfaces: 2,400 faces.
Clean level 2: 1,056 faces.
Removing those faces adds up. At level 3 a clean sponge has 18,048 faces; a lazy one has 48,000. The scripts can build either, to any level Maya’s memory will hold. That ceiling is higher in 64-bit Maya. Clean builds take longer. Memory use is roughly 200–250 bytes per vertex.
“Clean” here also means watertight: no hidden faces, and every remaining face could be seen from outside if a camera could sit in the voids. Filled with water from the inside, these sponges would not leak. They have neither leftover internal surfaces nor duplicated vertices.
I have built clean sponges through level 6 in Maya. Level 6 and above really want a 64-bit session.
These scripts were useful for stress-testing software and hardware at Alias|Wavefront (owner of Maya before Autodesk), at DreamWorks Animation (interactive display in Premo, and the MoonRay renderer), and on personal work, some of which is below.
A simple animation of Menger sponges (Menger cubes) from level 0 through 5:
Content, images, and animation copyright © 1997–2026 Peter C. Miller.
Lower corner view:
Hardware display capture with Maya’s “Wireframe on Shaded” on. The openings are easy to count, from the largest holes down to level 5.
Unoptimized:
With Maya’s Poly Count display on, you can see the unoptimized mesh: 36,096 triangles. That is what the graphics engine has to draw. Compare that with the optimized version below.
Optimized:
Same level-3 sponge, but each level-1 cube has had unneeded vertices merged. Triangle count is now 27,648 — over 23% lower.
“Street view”:
This view sits slightly above the lowest level, looking up through the sponge as if it were a building. At that scale the form is a study in fractal architecture and hierarchical porosity — a different idea from the slender “pencil towers” that have multiplied in Manhattan and other financial districts. Those towers chase height and floor-plate efficiency on a tiny footprint, and they pay for it in wind response, stacked construction tolerances, and concentrated load. A Menger sponge building would distribute mass, punch volume full of voids, and repeat the same pattern at every scale.
Cutting cubes out, iteration after iteration, leaves a light, redundant lattice. Load moves through a network of smaller members at each level. That organization is close to natural porous structures — especially the diagonally braced skeleton of the glass sponge Euplectella aspergillum (Venus’s flower basket), whose crossed bracing has been shown to resist buckling and to carry a lot of load for its weight.
(wikipedia.org)
(materialdistrict.com)
At building scale, that porosity would cut dead load and still leave many paths for gravity, seismic, and wind forces. The openings would also let daylight and air deep into the volume, and make room for planted sky courts in the voids — closer to biophilic and passive-performance goals than a sealed glass shaft.
The most interesting architectural idea may be the voids themselves. Each iteration adds a continuous grid of corridors and shafts — a three-dimensional graph of routes baked into the structure. Those channels could be built as multi-directional transit: a city-scale movement system that is also the building. Ropeless elevator systems such as TK Elevator’s MULTI (formerly ThyssenKrupp) already show cabins that can travel vertically, horizontally, and on loops in shared shafts, driven by linear motors or maglev.
A Menger lattice would supply those shafts at several scales: large atria and cross-tunnels at the early iterations for high-capacity loops, and finer channels at later iterations for smaller or autonomous cabs. Riders could take direct paths through the matrix instead of the usual up-then-across bottleneck. Extra routes would help with safety; traffic software could balance flow across the whole network. That is point-to-point movement in three dimensions — an old goal in visionary urbanism and arcology schemes.
The look would split people immediately. The raw recursive geometry reads as science-fiction megastructure, but that honesty of construction also leaves room for façade work: glazing, perforated metal, precast, or adaptive solar skins on the smallest cubes, changing light, shadow, and heat while keeping the self-similar pattern visible at every scale. The porosity would be the architecture — a building that is both massive and open, monumental and finely divided.
Content, images, and animation copyright © 1997–2006 Peter C. Miller.
An early concept piece: sponges multiply into the next depth instead of subdividing. From a standing person’s point of view, a one-inch level-0 cube grows into a 1,640-foot level-9 sponge.
Levels above 4 were faked with procedural texturing so the shot would fit in 32-bit memory. The idea owes something to the old Powers of Ten films. I still plan a second version with scale references — basketballs, chairs, cars, boats, 747s — so the size is easier to read. Built in Maya, with MEL driving the animation.
A short film of Menger sponges on a lonely planet, pushing scale until it turns unsettling:
Content, images, and animation copyright © 1997–2006 Peter C. Miller.
More recent Menger sponge renderings with open-source MoonRay, on LinkedIn.