What the painters were given

Stream 5: motifs out of the engine; trees that grow

notes/motifs.md · 199 lines · Notes

Given to 12 painters:

Stream 5: motifs out of the engine; trees that grow

Principle: the engine provides physics and tools; motifs belong to the painter. Knowing how trees grow is not cheating; the engine painting the tree is. So paint::tree::Oak (grew and painted one oak, the same for every [local account redacted]) is gone. The engine now has paint::growth (botany only, returns a skeleton), and painting a tree is the painter's habit in paintings/src/trees.rs.

What changed

Engine: crates/paint/src/growth.rs (replaces tree.rs)

A 3D bud-based growth model after Palubicki et al. 2009, "Self-organizing tree models for image synthesis", projected onto the picture plane:

Painter: paintings/src/trees.rs

Motif APIs take paint, not colors (finding 9)

Paintings

API in short

use paint::Habit;
use paintings::trees::{self, Bark, TreeHand};
let oak = Habit { lean: 0.1, ..Habit::dead_oak() }.grow((115.0, ground), 400.0, seed);
let bark = Bark {
    dark: pal.paint(hex("#1f1a16"), 0.25),
    dead: Some(pal.paint(hex("#26211c"), 0.25)),
    light: Some(pal.paint(hex("#4a4034"), 0.35)),
    wood: Some(pal.paint(hex("#5d5244"), 0.3)),
};
let mask = trees::tree(&mut c, &oak, &bark, &TreeHand { light_from: (0.7, -0.7), ..Default::default() }, seed);
// your own habit: perches, snow on limbs, crows...
// live wood only: `!l.dead` alone would keep a leader's dead top
for l in oak.limbs.iter().filter(|l| l.order <= 2 && l.dead_from > 0) { /* l.pts[..=l.dead_from.min(l.pts.len() - 1)], l.w, l.dir(i) */ }
let perches = oak.tips();

let sp = Habit::spruce().grow((x, y), 180.0, seed);
trees::grown_spruce(&mut c, &sp, pal.paint(hex("#1c211d"), 0.1), seed);
trees::spruce(&mut c, (x, y), 12.0, pal.paint(hex("#353846"), 0.1), seed); // small/distant

figures::woman(&mut c, (x, y), 60.0, &Gown { dress, shawl: Some(shawl), hair, skin, rim: Some(rim) }, WomanPose::ArmsOpen, seed);

Evidence

All renders are in [local path redacted] (PNG plus a peeked JPG where noted):

Known issues / next

Source