threejs-trees: Grow a whole forest from a seed.
Twenty-nine species presets, from spruce to baobab to lily pad, grown branch by branch with no model files. Place one hero tree, or turn a species list into a streaming forest with levels of detail and impostors.
One tree, or a forest.
Spread a preset and override what you like. generateTree() returns plain geometries for a hero tree; createVegetationLayers() turns a species list into LOD'd, impostored layers for threejs-scatter.
import * as THREE from 'three/webgpu'
import { Scatter } from 'threejs-scatter'
import { createBarkMaterial, createLeafMaterial, createVegetationLayers,
generateTree, setTreeEnvironment, species } from 'threejs-trees'
// One hero tree
const params = { ...species.oak, height: 18 }
const { trunk, leaves } = generateTree(params, 7)
scene.add(new THREE.Mesh(trunk, createBarkMaterial(params)))
if (leaves) scene.add(new THREE.Mesh(leaves, createLeafMaterial(params)))
// A forest: variants, LODs and impostors per species
const layers = await createVegetationLayers({
species: [{ name: 'spruce', density: 0.6 }, { name: 'birch', density: 0.2 },
{ name: 'fern', density: 0.5 }, { name: 'boulder', density: 0.1 }],
renderer, // bakes the impostors
})
Scatter.create({ camera, scene, terrain, layers })
setTreeEnvironment({ windStrength: 0.5, snow: 0.3 })
import { Forest, Tree } from 'threejs-trees/react'
function Valley() {
const ground = useRef()
return (
<>
<mesh ref={ground} geometry={hills} />
<Tree species="apple" params={{ fruit: 0.4 }} seed={7} />
<Forest terrain={ground} seed={3} maxDistance={800}
species={[{ name: 'spruce', density: 0.7 },
{ name: 'birch', density: 0.2 }]}
environment={{ windStrength: 0.4 }} />
</>
)
}
Every tree is grown.
No model files and no leaf textures: branches, leaves, bark and rocks are all generated from plain JSON parameters and a seed. Every species below is in the lineup demo.
Twenty-nine species
From the boreal north to the tropics.
Conifers, broadleaves, savanna, desert and jungle trees, shrubs and ground cover, each a tuned TreeParams preset. Spread one and override any field: { ...species.oak, height: 20 }.
- Oak
- Beech
- Maple
- Birch
- Spruce
- Pine
- Fir
- Redwood
- Acacia
- Baobab
- Palm
- Jungle emergent
- Olive
- Cypress
- Mangrove
- Dead snag
- Cactus
- Shrub
- Dwarf shrub
- Thorn shrub
- Fern
- Reed
- Apple
- Berry bush
- Flowers
- Tall grass tuft
- Succulent
- Bamboo
- Lily pad

Space colonisation
Branches that grow toward light.
Attraction points fill a crown envelope (sphere, cone, column, umbrella, vase and more), and branches grow toward them step by step (Runions et al. 2007). Radii follow the pipe model, so the trunk thickens with every twig it carries.

Shrubs, plants and more
Ten generators, not just trees.
Besides space colonisation there are dedicated generators for palms, cacti, ferns, reeds, flowers, grass tufts, succulents, bamboo and lily pads, with stems, fruit and fruitColors for bushes, berries and blooms.
Rocks
Boulders to pebbles.
generateRock() displaces an icosphere with fBm lumps and Worley facets and cracks, cuts the base flat and grows moss on top. Five presets, from scree to cliff chunks, scatter alongside the trees.
- Boulder
- Rock
- Pebble
- Scree
- Cliff chunk
Leaves and bark from code
Nothing to download.
Leaf cards are drawn procedurally per shape: broad, needle, palm, fern and blade. TSL materials add wind, back-lit leaves, bark furrows and birch marks, and shift hue, saturation and crown density per instance.
A forest in one call
Species list in, scatter layers out.
createVegetationLayers() grows a few variants per species, adds a simplified mesh and bakes octahedral impostors, scaled to each species' size. Pass a density function to drive it from a biome table.

Weather hooks
Wet, snowy, burnt, broken.
Bark, leaf, fruit and rock materials read wetness, snow, burn and damage: snow settles on upward faces, bark chars along its furrows, leaves scorch and drop, branches break off. Set them globally with setTreeEnvironment() or drive them per material from your own TSL nodes.
Made for React too
<Tree> and <Forest>.
<Tree> places one generated tree with any group props. <Forest> takes every <Scatter> prop plus the vegetation options, bakes impostors with the R3F renderer and picks up the first directional light as the sun.
Plant something.
Walk the forest or inspect every preset in the lineup demo, or go straight to the API reference.