{"id":126,"date":"2026-11-25T19:18:22","date_gmt":"2026-11-25T23:18:22","guid":{"rendered":"https:\/\/the-algorithmist.com\/?p=126"},"modified":"2026-11-25T19:18:23","modified_gmt":"2026-11-25T23:18:23","slug":"terrafractal-part-10-a-forest-from-the-leaf-up","status":"publish","type":"post","link":"https:\/\/the-algorithmist.com\/index.php\/2026\/11\/25\/terrafractal-part-10-a-forest-from-the-leaf-up\/","title":{"rendered":"TerraFractal, part 10: a forest from the leaf up"},"content":{"rendered":"\n<p>A forest has to look right from a few metres and from a few hundred kilometres. No single way of drawing trees can do both, so there are several, and the hard part is making them agree.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The early forest<\/h2>\n\n\n\n<p>The very first trees were green cones. Fine from a plane, obviously wrong on foot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1400\" height=\"644\" src=\"https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/early-cone-forest.jpg\" alt=\"The first forest\" class=\"wp-image-99\" srcset=\"https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/early-cone-forest.jpg 1400w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/early-cone-forest-300x138.jpg 300w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/early-cone-forest-1024x471.jpg 1024w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/early-cone-forest-768x353.jpg 768w\" sizes=\"(max-width: 1400px) 100vw, 1400px\" \/><figcaption class=\"wp-element-caption\">The first forest: one cone per tree.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Trees from the planet<\/h2>\n\n\n\n<p>Trees are generated from a &#8220;genome&#8221; set by the planet and the site: gravity, wood strength, light and the biome set the branching angles, droop, leaf size and crown shape. The site adds lean down steep slopes, flagging in strong wind, and stunting near the treeline. Same code, alien plants on alien worlds.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Every distance is a picture of the one below<\/h2>\n\n\n\n<p>The chain, from close to far:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>a real 3D leaf or needle spray;<\/li>\n\n\n<li>a leaf cluster, baked from many angles out of real leaves;<\/li>\n\n\n<li>the tree, built from clusters;<\/li>\n\n\n<li>a tree impostor: a flat picture of that tree, baked from many angles, out to about 6 km;<\/li>\n\n\n<li>a stand patch: a picture of 10-40 trees together;<\/li>\n\n\n<li>beyond that, canopy shading in the ground itself.<\/li>\n\n<\/ol>\n\n\n\n<p>Each level is baked from the one below it, so they match when one fades into the next.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1400\" height=\"613\" src=\"https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/plant-lab-pines.jpg\" alt=\"Pines in the plant lab\" class=\"wp-image-109\" srcset=\"https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/plant-lab-pines.jpg 1400w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/plant-lab-pines-300x131.jpg 300w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/plant-lab-pines-1024x448.jpg 1024w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/plant-lab-pines-768x336.jpg 768w\" sizes=\"(max-width: 1400px) 100vw, 1400px\" \/><figcaption class=\"wp-element-caption\">Pines in the plant lab. The nearest are full 3D trees; down the row they switch to pictures of themselves.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"494\" src=\"https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/leaf-clusters.jpg\" alt=\"Leaf clusters on a branch up close\" class=\"wp-image-105\" srcset=\"https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/leaf-clusters.jpg 738w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/leaf-clusters-300x201.jpg 300w\" sizes=\"(max-width: 738px) 100vw, 738px\" \/><figcaption class=\"wp-element-caption\">Leaf clusters on a branch up close.<\/figcaption><\/figure>\n\n\n\n<p>I got there the long way. The leaf cards had gathered a pile of shader tricks to make flat cards look 3D: height maps, leaves shading leaves, bumps, two-toned faces, sprays turning toward the camera. It was trying to do too much in one step. Baking real 3D leaves into clusters, then clusters into trees, replaced all of it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conifers<\/h2>\n\n\n\n<p>Needles were the hardest. I tried, and rejected, five approaches: puffs of needles, single sprig cards facing the camera, tilted pairs of cards, sprays that turned toward the viewer, and a dark inner shell. What worked was copying how the tree grows: whorls of branches one year&#8217;s growth apart, about 0.45 m, and flat sprays of branchlets in each bough&#8217;s plane.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Three forests in one place<\/h2>\n\n\n\n<p>The worst bug wasn&#8217;t visual. Three separate models described the same forest. The ground colour assumed about 60% canopy cover. The trees used a stem count per hectare. The stand patches used another. Nothing made them agree, and with full-size crowns the trees stacked five or six layers deep over ground coloured as open woodland.<\/p>\n\n\n\n<p>The fix was one model. The site sets how much crown area there is per area of ground. Trees are scattered at random, so crowns overlap, and the cover is what&#8217;s left visible. Stem counts follow from crown size. Temperate rainforest went from 0.035 stems per square metre to about 0.002: huge crowns, few trees. The drawn canopy then covered 84% of the ground where the terrain assumed 86%.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1400\" height=\"616\" src=\"https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/forest-380m.jpg\" alt=\"A tropical forest from about 400 m up\" class=\"wp-image-101\" srcset=\"https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/forest-380m.jpg 1400w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/forest-380m-300x132.jpg 300w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/forest-380m-1024x451.jpg 1024w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/forest-380m-768x338.jpg 768w\" sizes=\"(max-width: 1400px) 100vw, 1400px\" \/><figcaption class=\"wp-element-caption\">A tropical forest from about 400 m up: single trees close by, stand patches in the middle distance, canopy shading on the horizon.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The forest floor<\/h2>\n\n\n\n<p>Close up, the ground under trees is leaf litter. It started as twelve texture lookups with tricks to fake depth, which cost more than everything else on screen combined. It&#8217;s now a baked pile of real dead-leaf meshes: three lookups instead of twelve.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"800\" src=\"https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/litter-pile.jpg\" alt=\"The baked leaf-litter pile used for the forest floor\" class=\"wp-image-106\" srcset=\"https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/litter-pile.jpg 800w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/litter-pile-300x300.jpg 300w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/litter-pile-150x150.jpg 150w, https:\/\/the-algorithmist.com\/wp-content\/uploads\/2026\/11\/litter-pile-768x768.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">The baked leaf-litter pile used for the forest floor.<\/figcaption><\/figure>\n\n\n\n<p>The same rule holds for shaders as for trees: every detail fades to its average once it&#8217;s smaller than a pixel. That lets a tile switch to a cheaper way of drawing itself with no visible seam, and it stops paying for leaf litter when you&#8217;re looking from orbit.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A forest has to look right from a few metres and from a few hundred kilometres. No single way of drawing trees can do both, so there are several, and the hard part is making&hellip;<\/p>\n","protected":false},"author":1,"featured_media":99,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,26],"tags":[],"_links":{"self":[{"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/posts\/126"}],"collection":[{"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":1,"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions\/136"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/media\/99"}],"wp:attachment":[{"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/the-algorithmist.com\/index.php\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}