landing/art/loop.py
The render -> look -> fix loop, frozen in four stages of the same 3D scene.
Render it yourself: atelier render loop.py --preview (it imports _common.py for the palette and output folder).
# The render -> look -> fix loop, frozen in four stages of the same 3D scene.
# STAGE=1 blockout · 2 materials · 3 light · 4 finish (render_all.py runs all four)
import os
import numpy as np
from atelier import *
from _common import *
STAGE = int(os.environ.get("STAGE", 4))
grey = lambda: Mat("#9a9a9a", rough=0.8)
pick = lambda m: m if STAGE >= 2 else grey()
s = Scene()
s.add(box(5, 0.1, 2.4).move(0, -0.05, 0), pick(Mat(wood(rings=18, seed=2).ramp(["#3a2412", "#5e3a1e", "#7d5230"]),
rough=0.45, proj="xz", tex_scale=0.5)))
s.add(plane(-1.2, (0, 0, 1)), pick(Mat("#2b2622", rough=0.95)))
pot = lathe([(0.0, 0.0), (0.24, 0.01), (0.3, 0.12), (0.28, 0.3), (0.16, 0.42), (0.1, 0.5), (0.14, 0.56)], thickness=0.025)
spout = capsule((0.25, 0.18, 0), (0.46, 0.42, 0), 0.04)
s.add((pot | spout).move(-0.5, 0, -0.2), pick(Mat("#c8743c", rough=0.25, metal=1))) # copper pot
s.add(sphere(0.2).move(0.2, 0.2, 0.05), pick(Mat("#eef6f2", glass=1, rough=0.02, ior=1.5))) # glass ball
s.add(round_box(0.26, 0.26, 0.26, 0.02).rotate(y=30).move(0.72, 0.13, -0.25), pick(Mat(TEAL, rough=0.3)))
lemon = ellipsoid(0.13, 0.09, 0.09).displace(noise3(60, 2, seed=5), 0.004).rotate(y=-20)
s.add(lemon.move(0.62, 0.09, 0.35), pick(Mat("#f2c200", rough=0.35, sss=0.35)))
s.add(sphere(0.07).move(-0.05, 0.07, 0.42), pick(Mat(VERMILION, rough=0.2, sss=0.3)))
if STAGE >= 3:
s.area(pos=(-2.6, 2.2, 1.6), size=(1.4, 1.8), normal=(1, -0.6, -0.5), color="#ffe6c2", power=50)
s.area(pos=(2.4, 0.8, 1.2), size=(1, 1.4), normal=(-1, -0.2, -0.4), color="#7fc9d6", power=8)
s.add(box(0.05, 1.8, 1.4).rotate(y=-30).move(-3.4, 2.4, 1.8), Mat("#000000", emit="#fff1dc", power=6))
s.sky("#1d1d24", "#2c2620", "#100c09", power=0.18)
else:
s.sun((0.3, 1, 0.6), "#ffffff", power=2.5, soft=0.2)
s.sky("#7f8a99", "#a7a39b", "#3a3530", power=0.6)
s.camera((0.1, 0.75, 2.4), (0.1, 0.18, 0), fov=32)
c = Canvas(1200, 750)
r = c.render(s, aa=2 if STAGE >= 3 else 1, exposure=0.1 if STAGE >= 3 else 0, look="punchy" if STAGE >= 4 else None)
if STAGE >= 4:
c.apply(depth_of_field(r.depth, focus=r.focus_at(560, 470, c.s), aperture=3.5), bloom(0.82, 12, 0.35),
color_balance(shadows=(-0.02, 0.0, 0.03), highlights=(0.03, 0.01, -0.02)), vignette(0.45), grain(0.014, seed=SEED))
c.save(out(f"loop-{STAGE}.jpg"), quality=90)