←

Growing a Photoreal Bonsai in Code

A build log by Roman Slack

Build log · November 2026

No hand modeling. No bought assets. One afternoon of me reacting to renders in plain words while Claude wrote the code and Blender rendered it on my home GPU. This is how a bent tube with a picture on it turned into a juniper I'd actually post.

The final procedural juniper bonsai: a short, contorted trunk of bleached deadwood and red peeling bark under a wide, low canopy of separate foliage clouds, in an unglazed clay pot on a weathered wooden stand, garden blurred behind
The final tree. Every branch, shoot, grain of grit and moss stem is generated by a script from a seed, so a new seed is a new tree.
9
rounds of feedback
~$7
of image generation for the whole day
1
RTX 4070 Super, 15 s to 2 min a render
0
parts modeled by hand
Five versions of the bonsai side by side: v1 flat image cards, v2 sculpted wood, v3 3D foliage, v4 the Shimpaku shape, v5 final in a garden
Swipe to see all five versions →

The one idea that mattered

Realism comes from real-looking images, not from patterns written in code.

Every time something looked fake, it was because code had drawn a surface: even color, perfect noise, straight lines. Every time it jumped to photoreal, it was because we started from photos instead. Real reference photos go into an image model, which makes the isolated pieces (one sprig on white, a 10 cm square of bark). Code only does what code is good at: structure and variety. Where the branches go, how the canopy sits, how big each piece is.

That's the whole trick. Here's the nine rounds it took to learn it.

Nine rounds

Every quote is exactly what I typed. Each one pointed at one fixable thing.

01

A pipe with a picture on it

"nah looks weird af"

The first pass was a bent tube wrapped in a bark photo, with flat image cards for the leaves. A bonsai's whole character is its wood, and that was the part built purely in code.

Version 1 of the bonsai: a smooth bent trunk and flat leafy cards in a white tray
v1. It reads as "bonsai" from across the room and as fake from anywhere closer.
02

Sculpt the wood

"they look way way better, keep going ... to get perfect"

Trunk, roots and branches became tubes fused into one body with a voxel remesh, then carved: twisting fibre ridges, knots, and the bleached deadwood band sunk in with raised live bark along its edges.

Version 2: a sculpted, twisting trunk with fused roots and fluted ridges, in a round brown pot
v2. The wood is real now. The leaves still aren't.
03

Foliage: stop using cards

"looks like a classic particle scatter ... not natural up close"

I wasn't sure I was right, so I asked to see a real Shimpaku close-up next to ours. Side by side, it was obvious.

"yeah definitely way off, they are way too just 2D cards"

Comparison: a real Shimpaku juniper foliage close-up, a real Shimpaku bonsai, and our foliage built from flat image cards
Real on the left, ours on the right. The comparison that ended the card approach.

So the foliage got rebuilt as grown 3D geometry. Every twig tip sends out shoots, and each shoot is a stem clothed in round, scale-covered cords. About 2.6 million faces.

"bro it's 100x better again holy shit, just a little too dark"

Close-up of the 3D juniper foliage: thousands of scale-leaved shoots in sharp focus against a blurred garden
The grown foliage at 100 mm. When the single pieces are too small to see, pure geometry works, because the eye only reads the pattern.
04

Missing the sauce

"nah shape is weird"

"nah you are missing the sauce"

"getting there yes we are so close"

Three tries at matching a reference Shimpaku. The sauce was proportion, not detail. The real tree is a short, thick, contorted trunk with an elbow, under a wide, low, lopsided mound of about 34 separate cloud clumps with dark gaps between them. We kept building a tall trunk under a round dome.

Shape attempt 1: a single dense dome canopy on an upright trunk
Try 1. One dense dome.
Shape attempt 2: a tall leaning trunk with stacked canopy lobes
Try 2. Too tall.
Shape attempt 3: a short contorted trunk under a wide, low umbrella of cloud clumps
Try 3. The sauce.
Shape refined: near-all-deadwood trunk with a thin live vein and grit soil with moss patches
Refined. Deadwood trunk, grit soil.
Side by side: the real reference Shimpaku bonsai and our matching procedural version
The reference next to ours, every round. Comparing against your own last version drifts. Comparing against the photo doesn't.
05

No right angles

"the branches look at some strange almost 90 degree angles"

Real branches leave their parent along the parent's direction and curve toward where they're going. Now every primary, secondary and twig does the same. Random angles read fake instantly.

06

Give it somewhere to live

"need more interesting background ... for an X post"

A real garden HDRI, a weathered plank stand, a 70 mm lens and the sun behind as a rim light. Blurring the garden inside the renderer came out as banded blotches, so the tree and background render as separate passes and the blur happens after.

The first garden post render of the bonsai on a wooden stand with a blurred garden background
First post render. The setting works. Now every surface has to hold up to it.
07 + 08

Pot and bark: kill the plastic

"pot looks bad"

"the bark ... comes across as plasticky"

Same lesson twice. The pot became aged, unglazed Tokoname clay from a generated 4K photo texture. The bark became 4K macro textures of stringy peeling bark and bleached deadwood, fully matte, box-projected so they can't stretch. Most "plastic" complaints were just a uniform sheen. Real bark, clay and moss barely reflect.

"the closeups of the bark look spectacular"

Macro close-up of the bonsai trunk base: red stringy peeling bark wrapping bleached silver deadwood, with blobby, smeared moss in front
The bark landed. Look at the moss in front of it, though. That's round nine.
09

Soil, 10x better

"the moss ground and dirt ruins it ... needs to be 10x better to match the bark"

Four passes. First, 24,000 real 3D grit granules: akadama, lava and pumice. Then a smear fixed, then stretched moss fixed.

"no detail at all on the mossy part ... specialize it for a close-up"

So the moss became 20,000 real shoots, each a stem with 12 spiralling leaves, dark at the base and bright at the tips, clumped into cushions.

Soil pass with 3D grit granules and moss made of strands, still flat in places
Grit in 3D, moss still flat.
Final soil close-up: a bright cushion of individual 3D moss shoots between akadama, lava and pumice grit at the pot rim
Final. 20,000 moss shoots.

The materials

None of these were painted or bought. Each one started from real reference photos (Wikimedia Commons, licensed, credits kept), went through Gemini's Nano Banana 2 at about ten cents an image, then got cut out or made tileable by a small script.

A few got replaced by real geometry later, and that's fine. Use images until the camera gets close enough that geometry has to take over.

Generated 4K texture of red, stringy, peeling juniper bark
Live bark. 4K, 10 cm a tile.
Generated 4K texture of bleached silver deadwood with cracks and knots
Deadwood. Cracks, knots, splinters.
Generated texture of aged unglazed Tokoname clay
Tokoname clay. From the reference pot.
Generated top-down photo of cushion moss with akadama grit
Cushion moss. The pot cover before 3D moss.
Generated cut-out of a single juniper shoot tip on white
Shoot tip. The v1 foliage cards.
Generated cut-out of a dense juniper sprig on white
Sprig. Filled the v1 pads.

A second tree, same code

Change the seed and the pot, and you get a different juniper. Seed 5 went into a blue glazed pot. I also asked for a red Japanese maple. "your red maple one is ugly." It was. We dropped it.

A second procedural juniper bonsai from seed 5 in a crackled blue glazed pot on a weathered wooden stand
Seed 5, blue glazed pot. Same generator, different tree.

And it has a job. The bonsai sits on the reception desk of The Gym, a Nordic gym in a forest ravine in Norway that I'm designing entirely through conversation with an AI.

The bonsai on a stone ledge of the slatted oak reception desk at The Gym, under a forest oil painting
In place at the reception desk.

What actually made the difference

  • Images for surfaces, code for structure.Anything code draws looks drawn. Start every surface from a photo.
  • Compare against the real photo, every time.The biggest jumps came the moment a real close-up sat next to ours.
  • Find the thing's character first.A bonsai is its wood and its silhouette. Spend the effort there.
  • Structure follows growth.Branches curve out of their parent, shoots grow from twig tips. Random scatter reads fake.
  • Matte unless you know it's shiny.Most of the "plastic" was a uniform sheen.
  • Proportion beats detail.Three rounds of "the shape is weird" were all proportions.
  • Plain feedback is enough."weird af," "missing the sauce," "plasticky." Short, honest reactions and fast iterations beat a long spec.

I'm not a 3D artist. I just know what a real tree looks like and I said so, every round, in plain words. That turned out to be enough to get from a pipe with a picture on it to something I'd post. I think that's where this is all going: taste becomes the skill, and the AI does the rest. I'm going to keep pushing it to see how far it goes.