Log inGet started
World

The House Wears a Face

Branchmain
Branchesmain
Commit8e7f3baa4a

README.md

demo.look

The film's light and its print. Thirty-two lights, the sky, the ambient, the two clerestory discs, the lens, the film stock, the tone curve and the grade cube — and nothing else. Owns /source/demo/look.module/ and /source/demo/look/.

Every one of those is a pure function of the film clock. look.apply(t) writes every light's intensity, every filament's emissive, the depth of field, the meter, the film stock and the tone curve's exposure for one instant; LookDirector calls it once a frame with the cutscene's own time. So two takes are the same film by construction, and look.apply(t) from an execute scrubs the film to any second for a still.

Exports

callwhat it answers
look.apply(t)Write the whole look for film second t.
look.levels(t)Every light group's gain at t, in 0..1.
look.ambient(t)The ambient the film sits on at t.
look.lens(t)The shot's aperture, focal length and focus distance.
look.stops(t)The print's gain at t, in stops.
look.exposure(t)The meter's settings at t. Its compensation is zero: the print's gain belongs to the tone curve.
look.film(t)The film stock and the glass — grain, streak, flare, dirt.
look.grade(r,g,b)The grade as a plain function, so a colour can be checked without rendering a frame.
look.impactAt()The film second the chandelier lands — K.IMPACT.
look.dressing()The bulb run of the dressing mirror — K.DRESSING.
look.install() / look.uninstall()Build or remove the post chain.
look.setEffect(name, prop, v)Write one post effect's property, if the chain is standing.
look.ensure(parent)Put back any light, filament or disc that is missing.
look.invalidate()Drop the cached component handles after a scene rebuild.
look.content(root) / look.register() / look.reset()The slice contract.

look.RIG is every light in the film as a table, look.DISCS the two clerestory glows, look.state the two moments the schedule keys off (fallT, closeT) plus the bulb order and the installed cube's guid.

The post chain

Five effects, in this order:

prioritynamespacewhat it does
10look_bloomlightThe halation off every practical, thresholded on radiance.
20look_tonemaplightThe film's shoulder, and where the print's exposure is applied. See demo/look/tonemap.shader.
30look_chromalightChromatic aberration at the frame edge.
40look_vignettelightThe barrel.
50look_lutdisplayThe 32-entry grade cube graded() builds.

Bloom is in front of the curve because a bloom threshold is a statement about light and there is nothing above white left to threshold once the curve has run. The cube is behind it, in display space, because a colour table is authored against the code values a frame arrives at.

The exposure is on the tone curve, not on the meter. The display stage applies its transfer after every post effect has run, so a gain given to AutoExposure lands after any shoulder in front of it and a two-stop print push takes every practical past white before the frame is encoded. look.stops(t) therefore goes to look_tonemap.exposure as 2 ^ stops, and the AutoExposure component keeps only the metering — auto until t = 34, so the lightning is allowed to arrive late, and manual with zero compensation after.

The cube is built once per session, guarded on state.lutGuid: a 32-entry cube is half a megabyte of texture and installing it re-encodes all of it.

The print

TRIM carries each shot's trim in stops on top of BASE_STOPS, tweened over the first 0.6 s of a shot so a boundary is a ramp rather than a step. A shot is a room and a framing as much as a moment — the exteriors are two lamps in forty metres of rain, the mask wall is a raking light two and a half metres from the lens, and shot 12 hangs the camera inside the shaft it is lit by — so each is dodged or burned to sit with the rest, which is what a print IS.

graded() is the grade as arithmetic, and lut.build(32, graded) bakes it into the cube. It is near-monochrome except for a chroma gate that lets cadmium red and chrome yellow through and takes a low-chroma candle wash almost to grey, which is what holds the saturated colour to the few per cent of frame the film allows it.

Notes

  • Nothing here reads wall-clock time or calls math.random. hash01 is the deterministic stand-in, and flicker is three incommensurate sines.
  • LK_FloorRake is shot 7's raking key: low, at the east end, thrown west along the checkerboard so a risen white square catches a highlight and a sunk black one sits in a shadow. It is the only light in the film that rakes the floor.
  • The bulb run reads K.DRESSING, which the props slice also reads for the glass and the filament tick, so a bulb's light and its glass die together.
  • The light loss at the fall keys off K.IMPACT — the second the body lands, not the second the cable parts.