What the painters were given

Scene: one world, one sun

notes/scene.md · 284 lines · Notes

Given to 1 painter:

Scene: one world, one sun

Branch scene. This stream answers what the user saw in amnesia round 2 (notes/amnesia2.md, item 11 and the coast and mountains notes):

The cause: each Form had its own Light, and nothing knew where the ground, the eye or the sun was. Now a World holds all three, and every solid, shadow, contact and reflection takes them from it. Like form, it paints nothing. The study that shows it paints with brushes.

What changed

API, briefly

use paint::scene::{Sun, Water, World, What};

// one world per picture (or per panel)
let mut w = World::new([0.0, 0.0, 1000.0, h], h * 0.36, 1.6)   // view, horizon y, eye m
    .fov(1000.0, 55.0)
    .ground(|x, z| 0.05 + 0.03 * (x * 1.3).sin() - 0.12 * pool(x, z))
    .water(Water::new(0.0).ripple(0.03, 1.4, 0.3, 7))
    .sun(Sun::deg(-72.0, 9.0))          // low, from the left
    .backdrop(700.0);                    // the far shore is ~700 m off

// a boulder on the sand, sunk a hand deep
let s = w.spot_at(3.1, 9.4);
let rock = Sdf::block(s.p(0.0, 0.4, 0.0), s.size(1.35, 1.0, 1.1), s.m(0.36))
    .turn(s.p(0.0, 0.4, 0.0), 0.6, 0.06, -0.08).rough(s.m(0.07), s.m(0.7), 3, false);
let boulder = w.place(s, rock);
// a pole standing on the bottom of the sea
let s = w.spot_bed(-4.2, 21.0);
w.place(s, Sdf::block(s.p(0.0, 1.6, 0.0), s.size(0.13, 3.2 - s.at[1], 0.13), s.m(0.05)));
// a figure written with gestures: a proxy for her shadow, contact and reflection
let s = w.spot_at(0.0, 9.6);
let woman = w.proxy(s, Sdf::ellipsoid(s.p(0.0, 0.8, 0.0), s.size(0.25, 0.85, 0.2)));
figures::woman(c, (s.x, s.y), s.m(1.7), &gown, WomanPose::Standing, seed);

let view = w.view(c.frame());
let sand = |x, y| { let p = view.at(x, y); mix(shade_col, lit_col, smoothstep(0.0, 0.12, p.shade.turn), Mix::Pigment) };
let shadows = view.shadows().mul(&view.land());          // stroke along w.shadow_angle(x, y)
let seam = view.contact(0.22);                           // a dark seam grounds stone and feet
rocks::paint_solid(c, st, &view.form, &Solid { parts: vec![view.part(boulder)], .. });
let mirrored = |x, y| view.mirror(x, y).map(|m| /* m.body, m.src, m.shade, m.fresnel */ ..);
let path = Mask::from_shape(c.frame(), w.ribbon(&[(-2.6, 4.5), (-1.6, 8.6), (-0.4, 9.7)], |t| 1.1 - 0.4 * t));

Evidence

cargo paint study_scene paints the same shore three times on one sheet: two fishermen's poles standing in the sea, a granite boulder at the water's edge, a woman at the edge of a tide pool, a trodden path running back to her and a far low shore. The scene is built once per panel; only the sun and the painter's colors change:

Everything is painted with brushes: sky, far shore, water mirroring the sky, sand lit by the world's light, cast shadows as a stroke pass along shadow_angle with the penumbra fused, the boulder by rocks::paint_solid from view.form, poles dark then lit on the side the sun finds, reflections stroked from mirror, the woman written by figures::woman at spot.m(1.7) with her light side from form_of, and last a transparent umber glaze through contact.

Judged as a painter:

Known issues and next steps

Commits

Round 4: depth masks (branch depth, see notes/depth.md)

Source