luft/render/studio.lisp
Either :PERSPECTIVE or :ISOMETRIC.
An isometric picture has no vanishing point, so two chamfers the same width are the same width on screen wherever they sit. That is what makes it the projection to judge a shape rule in.
Animation clock, in seconds, to hold the traveler at, or NIL to run free.
A character plate needs the same pose every time it is rendered. The viewer otherwise derives the clock from its own frame counter, which no capture can predict.
Absolute-pointer luft play: hover terrain, click a route, scroll zoom.
The original relative-pointer atelier orbit and direct keyboard mode.
Whether mode continuously points into luft terrain.
One retained semantic ray hit, suitable for sparse inspection.
luft sites remain packed integers in dense products. This object exists only
at the atelier boundary where a person has selected one site.
Return viewer to the sanctuary spawn and its following isometric view.
Reset is also a camera move: do not briefly reveal the old outside perch when the spawn happens to be indoors.
Return the atelier stock at face in source.
Return grid step, first crossing distance, and crossing interval.
Return the first outward luft face met by a continuous lattice ray.
Tied edge and corner crossings advance together, so a ray never reports a
cell it merely touches. The returned site-inspection is the one sparse object
boundary over the packed chain and dense face records.
Remember one carrier face for tied crossings, choosing the axis most aligned with the ray. All tied cells still advance together.
Keep a following camera on the traveler's side of sanctuary geometry.
The player can pass through a gate while the preferred isometric perch is
still outside the rampart. Cast from the look-at point to the *actual*
smoothed camera position, rather than the ideal perch: this preserves the
soft follow but never lets a wall sit between the eye and the hermit.
Match follow-walking-player's look-ahead exactly. This is
the point the player-owned frame promises to keep visible.
The sanctuary is finite while the pleasant isometric perch can look out across its edge. An off-map ray is simply no occluder, never a reason to park the frame.
Leave enough room for the near plane and an over-the- shoulder silhouette. The camera therefore tucks into the room smoothly instead of landing on the wall itself.
The four projection coefficients and the homogeneous-divisor selector.
Both projections use the same three rows: clip X and Y are the view coordinates scaled, and clip Z is an affine function of view depth. The perspective divisor is the view depth and the isometric divisor is one, so the selector is the whole of the difference.
One immutable camera sample shared by geometry and temporal motion.
MetalFX receives the current sample offset separately and its default motion-vector contract is unjittered. Retain the previous lane shape for ABI stability, but only the current two components participate in rasterization.
Return the world-space origin and direction through viewer's pointer.
Publish frame-boundary instruments, then borrow viewer's renderer.
An instrument operation may transactionally replace the complete renderer cohort and retire the previous one. No frame may borrow that previous cohort before the operation boundary, or it would encode through resources which the same canvas thread has just retired.
Inspector repaint is semantic and therefore sparse. Shader definitions
are independently live, so the static retained stream still refreshes its
direct compositor here, before encode-renderer-frame opens a pass.
Instrument state is now immutable for this frame. Encoding below only replays prepared GPU commands against the renderer borrowed afterward.
Dense lattice dots are a close-study diagnostic, not a terrain view:
streamed chunks can each contain more than a million markers. The
shader-backed construction lines remain controlled by *WIREFRAME*.
Instruments are ordered low-to-high so modal tools render last.
Draw viewer's current sparse ray hit as McCLIM presentations.
Application panes may follow their output cursor even without visible scroll bars; this fixed HUD stays pinned at its origin.
The frame is the application and the inspector is its first pane. Its command table inherits every input phase so McCLIM considers each command executable; event dispatch still chooses one phase explicitly.
Return viewer's texture view for the current presentation slot.
Release only viewer's cached view of surface, when one exists.
The first timestamp establishes the follow pose immediately. Subsequent zero-duration samples preserve it; in Common Lisp a numeric zero is true, so DT alone cannot express that distinction.
Drain completed meshes and admit the next mock residency change.
One complete neighborhood cohort crosses the owner boundary before another residency change can invalidate it.
Source callbacks only advance revisions. Compilation and complete cohort publication happen here, before this frame borrows the renderer.
Return the luft application receiving the current McCLIM command.
Begin an orderly stop once and return true when this call began it.
Native input closes capture admission without waiting. The worker below drains the capture beside this thread before crossing its frame barrier.
A native close and a command both run on the canvas thread. Reserve the
one teardown owner here, but run it beside that thread so its synchronous
frame-boundary barrier can complete before close-canvas ends the loop.
Install mode and make its pointer ownership immediately true on screen.
Install the atelier's held controls into their press and release tables.
Definition reloads replace the live vocabulary instead of stacking another item at the same gesture coordinate.
Return the window and atelier tables for key event.
Return the named McCLIM command viewer binds to key event, or NIL.
Window commands are global application controls: fullscreen, Tracy, quit, and pointer release remain available after Escape. Unmodified atelier/gameplay commands still require captured input; modified tools such as M-x deliberately remain global as well.
Only an upward horizontal surface promises a standable destination. Walls remain useful inspection targets but do not turn into surprising roof teleports.
Open the indexed-instanced luft renderer as a McCLIM atelier.
bevel-profile enables the experimental material-selected width cohorts for a
non-streaming scene. bevel-width remains the camera/inspection reference and
the uniform fallback. surface-mesh supplies an already constructed diagnostic
mesh while retaining solid as the semantic inspection source.
:copy-src drops the Metal framebuffer-only contract so
capture-viewer-frame can read the drawable back.
If source moved during construction, BEFORE deliberately remains the installed attempt: the first frame sees the newer AFTER revision and transactionally rebuilds.
Realization painted before the compositor existed; publish only the inspector pane for direct final-pass replay.
The radio is application infrastructure and remains active while its old detailed panel is hidden. The compact shared status line is the default visible representation.
The shared target is still alive. Evict only its cached view; normal drawable views remain warm.
Test and publication share the capture gate lock. If cleanup wins, a following stop request writes NIL afterward; if shutdown wins, cleanup cannot resurrect a terminal viewer.
Render one native-resolution viewer frame offscreen into pathname.
inspector-p defaults to viewer's inspector setting. A source-defined
evidence capture may override it when the subject is the geometry rather than
the atelier UI.
Film viewer offscreen into an MP4 at pathname.
before-frame, when supplied, receives the frame index before streaming and
rendering that frame. Recording is paced in real time so asynchronous chunk
production gets the same opportunity to publish as it does in the window.
Rebuild viewer at bevel-width or its material bevel-profile.
Force a complete renderer-cohort rebuild on viewer's canvas thread.
Release viewer after its stop controller granted this caller ownership.
A native request only closed admission. This sole off-canvas owner waits for the active capture to encode and evict its surface view before any renderer, canvas, or device release can begin.
A synchronous no-op after changing the clock is the frame boundary: no encoder still borrows application resources.
The live artifact is the renderer cohort's sole owner. It detaches the renderer before native retirement and makes release terminal even when the backend reports a retirement failure.
Native window and GPU device are deliberately the final handles.
Stop viewer exactly once and publish one result to every caller.
Native canvas-thread handlers use request-viewer-quit instead: a synchronous
owner or waiter is rejected there because teardown crosses a frame boundary.
Whether a ray hit gets a blueprint reticle and local triangle-edge lens.
How far, in cells, the atelier's pointer ray may inspect.
Either :PERSPECTIVE or :ISOMETRIC. An isometric picture has no vanishing point, so two chamfers the same width are the same width on screen wherever they sit. That is what makes it the projection to judge a shape rule in.
How many world units of height an isometric frame spans.
Animation clock, in seconds, to hold the traveler at, or NIL to run free. A character plate needs the same pose every time it is rendered. The viewer otherwise derives the clock from its own frame counter, which no capture can predict.
Multiplication and scalar scaling.
Division of two represented quantities.
Absolute-pointer LUFT play: hover terrain, click a route, scroll zoom.
The original relative-pointer atelier orbit and direct keyboard mode.
One retained semantic ray hit, suitable for sparse inspection. LUFT sites remain packed integers in dense products. This object exists only at the atelier boundary where a person has selected one site.
(&key (code t))((call tool-call) stream)(site)(site)(site)(site)(site)(&key (position
(vec3:make-vec3 (+ 70.0 +sanctuary-origin-x+)
(+ -18.0 +sanctuary-origin-y+) 50.0))
(yaw 2.2455373) (pitch -0.5165006)
(field-of-view 0.9599311))(x y z)Addition over compatible quantities.
(&optional (viewer *viewer*))(&key
(position
(vec3:make-vec3 (+ +sanctuary-origin-x+ 29.5)
(+ +sanctuary-origin-y+ 24.5) 14.0))
(heading-x 0.0) (heading-y 1.0) (speed +walking-player-speed+))(camera player &key (distance 18.0) seconds)(viewer)Keep a following camera on the traveler's side of sanctuary geometry. The player can pass through a gate while the preferred isometric perch is still outside the rampart. Cast from the look-at point to the *actual* smoothed camera position, rather than the ideal perch: this preserves the soft follow but never lets a…
(camera)Subtraction or unary negation.
(left right)(origin &rest direction-scales)(face)One authored solid and its vocabulary-closed material-placement field. The solid remains LUFT's topological truth. The sparse authored field stores only dense vocabulary offsets; semantic material objects remain at the scene boundary rather than being allocated per cell.
(scene face)(position direction)Compare compatible quantities and produce dimensionless values.
(solid cell-x cell-y cell-z axis step)(chain)Logical conjunction of tests and raw truth values.
(domain x y z &optional (extent +vertex-extent+) (polarity 1))Pack a canonical site inside DOMAIN's box. No coordinate wraps: anchors range over [0, limit] per horizontal axis, and a site extending along an axis cannot begin on that axis's far boundary.
(chain x y z)Treat positive cubic-site occurrences in CHAIN as Boolean occupancy. Cells above and below the Z range are air; probes beyond the horizontal box signal OUTSIDE-DOMAIN with the boundary restarts.
(domain geometric-face occupancy)(source face cell-x cell-y cell-z point distance)(domain site occupancy)Pack SITE's complete incident-cell star. Absent axes are enumerated in X,Y,Z order. Zero means the cell one unit below the site on that axis (direction -1); one means the cell anchored at the site (direction +1).
(source origin direction
&key (max-distance *inspection-reach*))Return the first outward LUFT face met by a continuous lattice ray. Tied edge and corner crossings advance together, so a ray never reports a cell it merely touches. The returned SITE-INSPECTION is the one sparse object boundary over the packed chain and dense face records.
(vector)Test whether two compatible scalars are equal.
The minimum of compatible quantities.
Test whether one compatible scalar is greater than another.
Logical disjunction of tests and raw truth values.
The componentwise absolute value of a raw value.
(vector axis)Test whether one compatible scalar is at most another.
The componentwise square root of a raw value.
The maximum of compatible quantities.
(width height field-of-view near far)The four projection coefficients and the homogeneous-divisor selector. Both projections use the same three rows: clip X and Y are the view coordinates scaled, and clip Z is an affine function of view depth. The perspective divisor is the view depth and the isometric divisor is one, so the selector is the whole of…
(index base)The non-negative remainder of integer division.
(frame-index width height)Sample a two-dimensional texture through a sampler at a UV coordinate.
(camera width height jitter)(view previous inspection-parameters ink-strength player
&optional (bevel-width luft:+mesh-bevel-width+) (exposure 1.0f0))Default bevel width in eighth-cell integer ticks (one quarter cell).
A ball to throw. The hand never runs out: each throw is a new body.
Global construction-edge strength. The atelier toggles it between 0 and 1.
(light center &optional (exposure 1.0f0))(viewer)A native destination with a lifetime and frame clock.
(viewer)(viewer)(left right)(viewer)A cell probe left its box. The signaling probe offers the boundary restarts TREAT-AS-AIR, TREAT-AS-SOLID, and USE-VALUE, so the caller's handler decides what lies past the edge: a world treats it as air, a chunk store answers from the neighboring chunk or defers, a test refuses.
Logical negation of one test or raw truth value.
(viewer)(viewer extent)(viewer surface)(viewer)(viewer pass surface-texture physical-extent)(viewer)(viewer)(viewer)(device color-format extent)(viewer source-values source-revision)(viewer)(viewer source-values source-revision)(viewer)(viewer)Publish frame-boundary instruments, then borrow VIEWER's renderer. An instrument operation may transactionally replace the complete renderer cohort and retire the previous one. No frame may borrow that previous cohort before the operation boundary, or it would encode through resources which the same canvas thread…
(renderer encoder surface-texture extent camera-uniform-data
&key jitter view player-p construction-p overlay-encoder)(mirror &key
(target-format nil target-format-p)
(depth-stencil nil depth-stencil-p))Prepare MIRROR's compositor for its current immutable GPU revision. Applications call this at their pre-pass refresh boundary even when McCLIM's semantic command stream is unchanged. It deliberately accepts only a direct GPU mirror: raster mirrors have no retained semantic revision and are not a fallback for…
(viewer encoder surface-texture extent
&key (inspector-p (viewer-inspector-p viewer)))(extent)(renderer)Replay COMPOSITOR's textureless McCLIM mirror into PASS under affine STATE. DESTINATION-TEXTURE describes the open pass for format and clipping. FRAME-TEXTURE names the bounded in-flight presentation slot whose host-visible buffers are safe to update; normally both arguments are the same texture.
(viewer extent)(site)(site axis)(stream y label value &key presentation)(pass-encoder vertex-count
&optional (instance-count 1) (first-vertex 0) (first-instance 0))(bevel-width)(viewer)(bevel-width)(viewer stream)(site)(mask)(mask)Resolve MASK into the regular occupied-side masks supported by this spike. The returned list has one regular mask per simple boundary-link cycle. Empty and full stars have no boundary and therefore return NIL. A cycle which needs duplicated radial vertices cannot yet be represented by the Blender regular star…
(mirror sheet function)Protocol class for objects receiving canvas events.
A MuPDF context: its allocator, its store, and its error stack.
(&key (beacon-placement *beacon-material-placement*)
(stair-boundary :low-wall))A broad Lonely-Mountains world carrying a bridge and walled sanctuary. This is the old Holm's architectural sentence with its material menagerie removed: rolling approaches, a channel and rising high rock; a diagonal processional way; a two-arched stone bridge; a gate, curtain wall, paired turrets, an arcaded hall…
A one-shot publication boundary around exactly one teardown execution. The controller is a separate object owned by an application. One caller changes RUNNING to STOPPING and executes the teardown; every other blocking caller waits for the same result or condition. STOPPED is terminal, so no resource-owning body…
(&key (name "application") blocking-thread-p)Make a one-shot stop controller named NAME. BLOCKING-THREAD-P, when supplied, is a quick predicate which is true on a thread that may request a stop but must never own or wait for one.
(context surface-texture)Return the stable presentation slot key for SURFACE-TEXTURE in CONTEXT. Applications use this to retain per-frame resources without assuming that a backend returns the same Lisp wrapper every time it revisits a native drawable.
(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
(&body body)(name &body body)(viewer surface)(viewer direction)(viewer direction active-p)(player &optional (detail "manual movement"))(viewer)(viewer timestamp)(player camera)(player source camera forward right seconds &key maximum-distance)(player)(viewer)(scene renderer production-system &key (limit 2))Test whether one compatible scalar is at least another.
(scene production-system bevel-width world-x world-y)(viewer timestamp)(application)(context function)(context)Return CONTEXT's configured drawable extent as (WIDTH HEIGHT), or NIL.
(viewer)(application)Close APPLICATION's capture admission without waiting for active work. This is safe on a canvas thread. Return true when this call closed admission, or NIL when shutdown had already been requested.
(controller function &key thread-name)Request FUNCTION as CONTROLLER's teardown on one new worker thread. Return true and the worker when this call reserved ownership, or NIL and NIL when a stop was already requested or published. The worker contains any failure after publishing it; WAIT-FOR-CONTROLLED-STOP and synchronous callers receive that exact…
(name (&rest lambda-list) documentation &body body)(&optional (viewer *viewer*)
&key (solid (make-mountain-sanctuary-scene))
(bevel-width
(and viewer
(viewer-bevel-width viewer)))
(bevel-profile
(and viewer
(viewer-bevel-profile viewer))))(&key (terrain-width 4) (architecture-width 1) (contact-width 2))(canvas enabled)Capture or release relative pointer motion for CANVAS.
(canvas enabled)Give CANVAS its whole display, or hand it back to the window manager.
(viewer mode)Physical keys whose press and release urge the active controller.
A simple Org table without formulas.
(viewer event)(frame event &key (command-table (frame-command-table frame)))Return the command COMMAND-TABLE binds to key EVENT, or NIL. McCLIM answers with the gesture itself on a miss and checks command enablement against *APPLICATION-FRAME*, so both details are established here.
(mode viewer canvas event)(player source x y z)(player origin direction)A scroll, carrying where the pointer was and how far the wheel turned. The amounts are in wheel notches rather than pixels, positive up and right, already corrected for a natural-scrolling platform -- what the window system says the user asked for, not what the hardware reported.
Raise a dimensionless value to a dimensionless power.
(&key
(solid (make-mountain-sanctuary-scene))
(bevel-width 2)
bevel-profile
surface-mesh
(camera (make-fly-camera))
(title "LUFT — click to walk · scroll to zoom · M orbit")
(width 1100) (height 800)
fullscreen-p
(inspector-p nil)
(frames-per-second 60)
(provider *gpu-provider*))Open the indexed-instanced LUFT renderer as a McCLIM atelier. BEVEL-PROFILE enables the experimental material-selected width cohorts for a non-streaming scene. BEVEL-WIDTH remains the camera/inspection reference and the uniform fallback. SURFACE-MESH supplies an already constructed diagnostic mesh while retaining…
If you're lucky, someone has bound this to a working GPU-PROVIDER.
(&key (title "luv canvas") (width 800) (height 600)
x y (visible-p t) (fullscreen-p nil)
(high-pixel-density-p nil)
(clock (make-demand-clock))
(time (make-lazy-clock))
(presentation-api :vulkan))Construct an unrealized SDL canvas. WIDTH or HEIGHT may be NIL, which asks the display for a size when the window is finally created.
(provider)Return the SDL presentation policy required by GPU PROVIDER.
(protected-form &body cleanup-forms)(provider &optional descriptor)(canvas gpu-provider &optional configuration)Create a GPU presentation relationship between CANVAS and GPU-PROVIDER. When CONFIGURATION is omitted, return the context unconfigured.
(pathname &optional (viewer *viewer*)
&key (inspector-p (viewer-inspector-p viewer)))Render one native-resolution VIEWER frame offscreen into PATHNAME. INSPECTOR-P defaults to VIEWER's inspector setting. A source-defined evidence capture may override it when the subject is the geometry rather than the atelier UI.
A McCLIM frame manager constrained by luv's current native host.
(&key (name "luv single CPU producer"))Make one sleeping SB-CONCURRENCY mailbox worker. There is intentionally no pool yet. One worker proves the ownership and publication protocol, prevents CPU oversubscription, and keeps completion order intelligible while taking expensive work out of an owner callback.
(canvas &key (name "canvas application"))(renderer key mesh)(renderer meshes)Transactionally replace the keyed MESHES as one visible residency cohort. MESHES is an alist of key to surface mesh. Every GPU slot is created before the renderer's table changes; a failed upload therefore leaves the installed cohort untouched. No frame can interleave with the owner-thread publication.
(scene profile)(source &key stock-function chamfer-stock-function
(bevel-width luft:+mesh-bevel-width+))A retained McCLIM command stream replayed into a caller-owned GPU pass. The caller supplies one 4x4 clip-space affine state and the actual destination texture for each frame. Semantic solids, analytic shapes, gradients, images, lattices, and Slug text are evaluated at that texture's native resolution; there is no…
(canvas function)Run FUNCTION with a timestamp on CANVAS's native frame/event thread. The initial native implementation is synchronous: the caller waits for the function's values. The protocol leaves room for a real frame scheduler.
A policy object deciding when a canvas should run frames.
(frame-function &key (frames-per-second 60))(system &key (timeout 10.0))(renderer)(application)Return APPLICATION's open LUV canvas for a native GPU capture. The shared implementation derives the presentation context and device through CANVAS-CONTEXT and CONTEXT-DEVICE; applications do not repeat those hooks.
(application capture)Prepare APPLICATION for CAPTURE on the calling thread. This is the place to wait for application-specific readiness and to quiesce a normal frame loop. CAPTURE's canvas, context, device, extent, and format are already established, but its shared GPU resources do not exist yet. CLEANUP-CAPTURE is called even when…
One screenshot or film transaction around an application-owned frame. The object is control-plane state, allocated once per capture. TARGET and READBACK-BUFFER are dense GPU resources owned and destroyed by the shared capture implementation.
(application capture frame-index)Advance application-owned work before offscreen film frame FRAME-INDEX. This runs on the film caller after BEFORE-FRAME and before GPU encoding. A streaming application can publish completed products here without putting its world model or simulation policy into the shared capture loop.
(application capture encoder target extent)Encode APPLICATION's complete visible frame into offscreen TARGET. This method runs on the canvas's native frame thread. ENCODER is open and owned by the shared implementation; EXTENT is the fixed two-dimensional capture extent. The method must not finish or submit ENCODER and must not destroy TARGET. Its primary…
(capture indicator &optional default)(application capture)Undo application-owned CAPTURE preparation on the calling thread. When shared GPU resources were created they are still alive and visible through CAPTURE-TARGET and CAPTURE-READBACK-BUFFER during this method. Applications with target-keyed GPU caches should synchronously evict those entries on their canvas thread…
(application function)Atomically call small publication FUNCTION only while admission is open. FUNCTION runs under APPLICATION's short capture gate lock and must not block or reenter the capture gate. Return true when it ran, NIL after shutdown began.
(application pathname &key options (label "application screenshot"))Render APPLICATION offscreen and write its native-resolution PNG. OPTIONS is an application-owned property list interpreted by the capture protocol methods. Return PATHNAME, packed pixels, width, height, color format, and the optional metadata value from ENCODE-CAPTURE-FRAME.
(viewer pathname
&key (seconds 8) (frame-rate 30) before-frame)Film VIEWER offscreen into an MP4 at PATHNAME. BEFORE-FRAME, when supplied, receives the frame index before streaming and rendering that frame. Recording is paced in real time so asynchronous chunk production gets the same opportunity to publish as it does in the window.
(application pathname
&key (seconds 8) (frame-rate 30) before-frame progress-function options
(label "application film"))Film APPLICATION offscreen into a real-time-paced H.264 MP4. The application chooses readiness, advancement, frame meaning, and cleanup; the shared implementation owns the fixed-size target, readback, ffmpeg writer, and absolute wall-clock pacing. Return PATHNAME and the encoded frame count.
An explicitly owned AVFrame.
(canvas function)(&optional (viewer *viewer*))(application)Close APPLICATION's capture gate and wait for its active capture to leave. The caller must run beside the canvas thread while a capture is active. The active capture may still need that thread for its final frame and cache cleanup; waiting on the canvas thread would deadlock it and is rejected explicitly.
(&optional (viewer *viewer*))Stop VIEWER exactly once and publish one result to every caller. Native canvas-thread handlers use REQUEST-VIEWER-QUIT instead: a synchronous owner or waiter is rejected there because teardown crosses a frame boundary.
(controller function)Run FUNCTION as CONTROLLER's sole teardown, or observe its published result. A concurrent caller waits while the owner runs. A later caller receives the same values or signals the same condition without running FUNCTION again.
The player owns the frame now: keep the playable view close enough to read footsteps and terrain relief without losing the next turn of the route.