TreeGen builds real 3D tree models from botanical parameters. Every
vertex, every bark texture and every leaf is computed in the browser — there is not a
single image or model file behind any of it.
Created by
Yigit Salih Emecen
Design, engineering and the parameter sets for the hand-tuned species.
What you can do with it
- Sixteen species presets, from a quaking aspen to a saguaro cactus, each a full
parameter set you can then take apart.
- Around sixty live controls — trunk taper and flare, per-level branching, crown
envelope, foliage, bark and epiphytes — all regenerating as you drag.
- Four seasons, thirty-one leaf shapes with five venation patterns, twelve bark
styles, two themes.
- Experimental forms, off by default: turn it up and trunks start running
horizontally for a stretch before elbowing back toward the light, throwing sharp
kinks, diving, or corkscrewing — the fallen-and-resprouted shapes.
- A moss, lichen and bracket-fungus system that grows real 3D forms onto the
bark — five moss forms, four fungus forms, placed by where they would actually
take hold.
- Randomise rolls an entirely new tree: growth habit, structure, foliage,
bark and epiphytes.
- Export to GLB (geometry plus the generated textures), OBJ,
STL for printing, a PNG of the viewport, or the parameter set
as JSON.
- Five levels of detail optimised from the same tree: LOD1–3 run the wood, moss
and fungus through meshoptimizer's quadric simplifier at a growing error bound, and
turn the foliage into crossed cluster cards painted from the real leaves; LOD4 is a
billboard impostor baked from LOD0. Auto switches between them by camera
distance. Export one, or all five with
_LOD0…4 names that game engines
turn into an LOD group, optionally meshopt-compressed.
Sharing
The address bar always holds the tree you are looking at — species, seed, season and
theme. Copy the URL and it opens exactly the same tree.
Built with three.js.
No build step, no bundler, no assets.
Two independent generators feed one mesh stage. Both come from published
computer-graphics research; the implementations here follow the papers' own equations.
1 · Parametric model
A tree is a recursion of stems. The trunk is a chain of segments, each rotated
away from the last by a curvature angle; stems split into clones along their length, and
spawn child branches whose length follows a crown-shape function. Radii come from a
length ratio raised to a falloff power, tapered by one of four continuously blended
modes. A flare equation swells the root buttress, a sinusoidal term gives non-circular
cross sections, and an optional envelope prunes the crown to a chosen silhouette.
Jason Weber and Joseph Penn, “Creation and Rendering of Realistic Trees”,
SIGGRAPH ’95, pp. 119–128.
ACM DL ·
PDF
Four of the presets — Quaking Aspen, Black Tupelo, Weeping Willow and
California Black Oak — are the parameter sets published in that paper's appendix.
2 · Space colonization
The crown volume is seeded with attraction points. Every growth node within an
influence radius of a point is pulled toward the normalised sum of its attractors and
grows one step in that direction; points that come within a kill distance are consumed.
The competition between buds for space is what produces asymmetric, naturally uneven
canopies that pure recursion cannot. Branch thickness follows the pipe model.
Adam Runions, Brendan Lane and Przemyslaw Prusinkiewicz,
“Modeling Trees with a Space Colonization Algorithm”,
Eurographics Workshop on Natural Phenomena, 2007.
PDF
3 · Turning a skeleton into a mesh
Branch centrelines are smoothed with a Catmull–Rom spline and swept as generalized
cylinders using parallel-transport frames, so the cross section never twists along the
branch. Every stem is closed at both ends and its base is buried inside its parent with
a swelling collar, the way a real branch collar welds a limb to a trunk. Leaves are
genuine polygons — one parametric width function covers ovate through pinnate outlines
and a polar lobe function covers palmate ones — cupped and drooped in three dimensions,
then merged into a single buffer so a thirty-thousand-leaf canopy is one draw call.
4 · Moss, lichen and fungi
Epiphytes are placed by score, not scattered. Every candidate site on the bark is
rated — moss for the shaded side of the trunk, the lower stretch of it, the upper
surfaces of near-horizontal limbs and thick wood over twigs; bracket fungi for vertical
wood, sideways-facing surfaces and the lower trunk — with a 3D value-noise term so the
growth clumps into patches instead of freckling the whole tree. The best-scoring sites
are then used first, so turning the coverage down thins the growth back toward the spots
where it would really be. Flat forms are bent around the branch before they are placed,
because a rigid disc on a curved limb reads as a blade sticking out of the bark.
Spreading mats, carpets, velvet fuzz, low cushions, foliose lichen, hanging strands,
shelf conks, turkey-tail fans, cap clusters and cup fungi are all built as 3D meshes and
merged into one buffer each.
5 · Textures
Bark is tileable anisotropic value-noise fBm, drawn to a canvas and turned into
colour, a Sobel-derived normal map and a roughness map. Leaf venation is drawn. The sky
is a gradient run through a prefiltered environment map so the physically-based
materials have something to reflect.
Further reading
- Aristid Lindenmayer, “Mathematical models for cellular interaction in
development”, Journal of Theoretical Biology, 1968 — the original L-system.
- Przemyslaw Prusinkiewicz and Aristid Lindenmayer,
The Algorithmic Beauty of Plants, Springer, 1990.
Free online
- Masaki Aono and Tosiyasu Kunii, “Botanical Tree Image Generation”,
IEEE CG&A, 1984 — branching and divergence angles, the Schimper–Braun law
behind the 137.5° phyllotactic spiral used here.
- Philippe de Reffye et al., “Plant models faithful to botanical structure and
development”, SIGGRAPH ’88.
- Leonardo da Vinci's rule and Murray's law — the pipe-model exponent that sets how
branch radius divides at a fork.