What the painters were given

Atmosphere: structure at the scale of the sky

notes/atmosphere.md · 297 lines · Notes

Given to 1 painter:

Atmosphere: structure at the scale of the sky

Branch atmosphere. This stream answers the user's verdict on amnesia round 2 (notes/amnesia2.md): "the sky still looks a little too neat", "the separation between the sea and the sky is too neat", "the mountains read as waves."

The diagnosis: we had added entropy at the scale of single marks (stipple grain, stroke curvature), but not at the scale of the picture's structure:

This stream adds physics and tools, not looks. The painter still decides every color and mark.

What changed

API, briefly

use paint::atmos::{Cloud, Clouds, Haze, Ranges, Sky, SkyField};
use paint::noise::{uneven, Octaves, Warp, Worley};

let w = World::new([0.0, 0.0, 1000.0, h], h * 0.6, 30.0).fov(1000.0, 58.0).sun(Sun::deg(-19.0, 4.5));
// the sky for that sun: uneven haze, a haze layer at 900 m
let sky = SkyField::new(Sky::new(w.sun).haze(2.6).uneven(0.6, 30_000.0, 11).layer(900.0, 500.0, 1.6, 0.8, 3), &w, 6.0);
let sky = sky.balance(sky.sky.sunlight(), 0.25);            // the eye half adapted to the low sun
// clouds in the world, lit by the same sun
let cf = Clouds::new(vec![
    Cloud::bank(-2_000.0, 30_000.0, 38_000.0, 9_000.0, 700.0, 2_600.0, 4),
    Cloud::cumulus(3_600.0, 10_000.0, 1_100.0, 2_600.0, 1_300.0, 8),
    Cloud::stratus(1_300.0, 700.0, 0.97, 31).wind(-0.5, 1.6).breaks(14_000.0, 0.22),
]).field(&sky, &w, 2.0);
let sky_col = |x, y| cf.color(&sky, x, y);                 // sky with clouds, as paint
let bellies = cf.mask(c.frame(), |p| smoothstep(0.5, 0.9, p.alpha) * (1.0 - p.lit));
let lit_edges = cf.mask(c.frame(), |p| smoothstep(0.4, 0.9, p.alpha) * smoothstep(0.35, 0.8, p.lit));
// the sea mirrors sf.at(x, y) below the horizon; far water fades to the airlight
let air = Haze::new(28_000.0).height(900.0).mist(140.0, 6.0, 90.0, 7);
let sea_far = |x, y| mix(sea(x, y), sky.airlight(x), air.loss(w.eye, z_of(y), 0.0, 0.0), Mix::Light);
// ranges: uneven, oblique, varied; one Ridge each for the painter's form
for l in Ranges::new(4_000.0, 50_000.0, 5, 17).heights(220.0, 2600.0).build(&w) {
    let ridge = l.ridge(&w, 0.0, 1000.0, 200.0, 260.0);                 // form::Ridge
    let hazed = |x, y, stone| mix(stone, sky.airlight(x), l.haze(&w, &air, x, y), Mix::Light);
}
// irregular spacing for anything repeated
let posts = uneven(9, 120.0, 860.0, 0.6, 0.4, 5);

Evidence

cargo paint study_sky (~60–75 s at 1000px on a busy machine) paints one landscape (the sea from a 30 m cliff top, with ranges built by Ranges running out into it) under three skies, plus a panel of ranges old vs new. Everything is painted with brushes and stipple:

--fields shows the engine's fields unpainted (a diagnostic, ~15–25 s).

Judged against the user's words, honestly:

Known issues and next steps

Commits

Source