captures/day-cycle.lisp
Call function with the fixed #TRYHPN session and its pinned sky clock.
The caller may change only the clock's pinned day fraction. Teardown restores
the process-wide grade even when session shutdown or function signals.
These controls are process globals because the renderer reads them on its canvas thread. Set them before constructing the pipelines and restore them only after the session is gone.
Capture one clean plate from the fixed day-cycle scene.
Hidden film frames do not pass through the presentation loop which normally supplies elapsed time to the cloud shader. Give this authored film its deterministic capture time explicitly.
The final encoded frame falls one interval before the starting hour, making the following playback-loop boundary continuous.
The complete fixed presentation grade shared by the day-cycle folio.
Overall scene exposure multiplied into the sky profile's own exposure.
Luminance at which a fragment starts contributing to the bloom chain.
How much of the blurred bright-pass image is added back in linear light. The chain's kernel is wide and runs twice, so this is a glow spread over a sixth of the frame rather than a halo: past about a third it stops reading as light around the sun and starts reading as fog over everything.
How strongly sunlight scattered around the solar disc streaks the frame.
Per-tap attenuation along a light shaft; nearer one reaches further.
Corner falloff of the presented frame, as a fraction of full brightness.
How far the lens splits red from blue at the corners, in texels.
Saturation of the presented image, one being the filmic curve's own.
How far the presented image is pulled toward an S-curve.
(day-fraction function)Call FUNCTION with the fixed #TRYHPN session and its pinned sky clock. The caller may change only the clock's pinned day fraction. Teardown restores the process-wide grade even when session shutdown or FUNCTION signals.
(&key (chunk-width 16)
(chunk-height 16)
(chunk-depth 16)
(seed 121))(x y z)(day-fraction)(&key
(title "luv little block world — click, look, walk")
;; NIL means "as much of this display as
;; comfortably fits"; a capture asks for the
;; exact frame it intends to write out. A
;; KMSDRM console can only present at a real
;; display mode, so the environment may pin
;; the canvas to the panel's native size.
(width (let ((value (uiop:getenv "LUVCRAFT_WIDTH")))
(and value (parse-integer value))))
(height (let ((value (uiop:getenv "LUVCRAFT_HEIGHT")))
(and value (parse-integer value))))
(frames-per-second 60)
(visible-p t)
(fullscreen-p nil)
(high-pixel-density-p t)
(world (make-empty-little-block-world))
(mesher (make-instance
'exposed-face-mesher))
(camera (make-instance 'fly-camera))
player
(selected-block *stone-block*)
(inventory (make-block-inventory))
quit-function
;; A hidden capture wanting animals in frame
;; hands in a population it has already
;; placed; the ordinary game grows its own
;; around the player as it plays.
(critters
(make-instance 'critter-population))
checkpoint-writer
(provider *gpu-provider*)
(sky-clock (make-instance 'sky-clock))
(sky-profile (make-default-sky-profile))
(shadow-diagnostic-p nil)
;; The world-text banner is a proof of the
;; Slug path, not scenery: a caller that
;; wants one asks for it, and the ordinary
;; game sky stays empty.
(world-text-string nil)
(world-text-font-pathname
(cl-dejavu:font-pathname "DejaVuSans.ttf"))
(world-text-distance 8.0)
(world-text-lift 3.0)
(world-text-units-per-em 0.55)
(video-pathname nil)
(video-distance 13.0)
(video-lift 4.5)
(video-height 5.0)
(residency-radius 6)
(publication-limit 2)
(load-schedule-limit 4)
(mesh-capture-limit 1))Open a little CPU-meshed block world. Click to capture the pointer, look with the mouse, walk with WASD, and jump with Space. Once captured, left click removes the block at the centre of view and right click places the selected block. Number keys select materials, middle click picks the targeted material, Shift…
(session overlay &key (release-p t))Detach OVERLAY at a frame boundary and optionally release it there. The no-release path is intentionally preserved for FUSE-LUVCRAFT-OVERLAY: that path may run inside a frame whose command stream still borrows OVERLAY.
(session &key minimum (timeout 10.0))Wait outside frame encoding for a useful initial set of chunk meshes. MINIMUM defaults to nine or the whole desired set when it is smaller. The visible startup path asks only for the nearest product before its first presentation; deterministic captures wait for the broader default set.
(session)Stop SESSION exactly once and publish its result to every caller. The sole owner attempts every named release step and closes the canvas and device last. Concurrent and later callers observe the same values or RELEASE-ERROR without releasing a native handle twice.
(pathname day-fraction)(session pathname &key camera-pose metadata-function
(include-hud-p t) (include-viewmodel-p t))Render SESSION once offscreen and write its native GPU frame to PNG. This works for both live and hidden sessions. The call returns only after GPU readback and compressed PNG writing have completed; it does not inspect the host window or depend on the window being visible. CAMERA-POSE may be a pose or a function of…
(name (&key figure kind extension (description "") (layout :landscape))
(pathname) &body body)Define one inspectable wiki capture recipe. NAME is its command-line identity. FIGURE is the stable six-character wiki figure ID; KIND is :IMAGE or :VIDEO; EXTENSION is the generated file suffix. LAYOUT is :LANDSCAPE by default or :PORTRAIT for uncropped 9:16 presentation. BODY is an ordinary named renderer function…
Multiplication and scalar scaling.
(session pathname
&key (seconds 8) (frame-rate 30) before-frame
(include-hud-p t)
(include-viewmodel-p t))Film SESSION for SECONDS of real time into an MP4 at PATHNAME. Frames are captured at FRAME-RATE, paced against the wall clock so that overlay animation driven by real time plays at its true speed. BEFORE-FRAME, when given, is called with the frame index before each capture, and is the place to move the camera. …
An explicitly owned AVFrame.
Division of two represented quantities.
The non-negative remainder of integer division.
Addition over compatible quantities.
A time-of-day folio should use one seed, one camera, one viewport, and one grade. Only the pinned sky-clock reading changes. That makes the default profile's midnight, sunrise, morning, noon, sunset, and dusk keyframes visible as a system rather than as unrelated pretty pictures. – little-world-blue-hour — the world…
One fixed little-world plate at six hours and across one continuous day. The clock is the only authored variable: world, camera, viewport, sky profile, presentation grade, and compositing layers stay fixed. #TRYHPN