luvcraft/text.lisp
The Slug renderer's tunable values, as knobs. The values themselves
live in luv.SLUG (see hal/shader/slug.lisp) and are folded into the text
shaders as literals; turning one rebuilds the world-text pipeline at the
next frame, so every glyph in the world -- signs, terminal walls, the
phone -- shows the change together. None needs a realization: the band
texture is not affected by any of these, only the shaders that read it.
The box filter's width in pixels. One is exact pixel coverage; wider softens the edge (and needs the dilation to grow with it, which it does).
How far past its outline each glyph quad grows, in filter widths. Half is the least that keeps the whole filter inside the quad; less clips the edge, more costs fragments.
The exponent applied to coverage. One is linear; the reference's SLUG_WEIGHT is one half, which fattens thin strokes.
0 fills glyphs by the nonzero winding rule, 1 by even-odd (self- overlapping contours become holes).
How the pixel's size in em is measured: 0 the gradient length, 1 fwidth as the reference does; between blends.
1 stops walking a band's sorted curves at the first one wholly behind the sample; 0 walks them all. The picture is the same either way.
Below this |a| a curve is solved as a line rather than a quadratic; also the floor under the coverage divisions.
1 paints each glyph quad with its band loads: red the horizontal band's curve count over sixteen, green the vertical's, blue the coverage.
Build one dense model-and-atlas record per drawable glyph occurrence.
ink is the linear rgb carried in the record's three spare lanes.
Create one owned Slug draw batch from caller-positioned glyphs.
The caller owns the semantic placement policy and supplies the dense instance records. This is the shared GPU boundary for ordinary shaped runs and the unified terminal surface in #7ZM22R.
Shape string once and create a depth-tested world text run on device.
The run owns dense placement/model data and its live pipeline; glyph-cache owns
font-and-glyph device resources reusable across runs. See #QW7P96.
Bind one shared glyph atlas to one drawable-frame uniform.
Publish one complete replacement instance population into run.
The caller owns the semantic candidate. This function creates and fills its
new GPU buffer before installing the new string, glyph, atlas, CPU-data, and
buffer cohort. Native destruction of the predecessor remains submission-aware
through the backend's ordinary destroy contract.
(name (&key label (group :grading) documentation
(class ''scalar-knob)
quantity (type 'single-float)
unit-label minimum maximum step)
place)Define NAME as a knob of CLASS over the setf-able PLACE. PLACE may refer to SESSION, so a knob can live on the session -- its sky clock, its player -- as well as in a special. QUANTITY is a quantity plist as DEFINE-QUANTITY-CONSTANT takes, (:quantity ... :unit ...); it and TYPE make the knob's declaration, which…
The box filter's width in pixels. One is the reference's exact pixel coverage; wider softens (and, past the dilation, clips) the edge.
How far a glyph's bounding quad grows past its outline, in filter widths (pixels when the filter is one pixel wide), so the filter's half-width and a little more always lie inside the quad. The reference dilates exactly half a pixel; a hair more forgives the per-vertex approximation of the pixel size across a…
The exponent applied to coverage. 1 is linear coverage; the reference's SLUG_WEIGHT is 0.5, a square root that boosts thin strokes.
0 fills by the nonzero winding rule, 1 by even-odd; fractions blend.
How the pixel footprint in em space is measured from the coordinate derivatives: 0 is the gradient length (L2), 1 is fwidth (L1), which is what the reference uses.
1 leaves a band's sorted curve list at the first curve wholly behind the sample; 0 walks every curve (the reference without its break).
Below this |a| a curve's polynomial is solved as linear; also the floor of every division in the coverage combination.
0 renders ink; 1 paints each glyph's quad with its band loads (red the horizontal band's curve count, green the vertical's, over sixteen).
How the children of a list are arranged.
(center right up x y scale)(x y z)Addition over compatible quantities.
Multiplication and scalar scaling.
(glyphs atlas center right up scale min-x min-y max-x max-y
&key (ink '(0.96 0.32 0.48)))Build one dense model-and-atlas record per drawable glyph occurrence. INK is the linear RGB carried in the record's three spare lanes.
A constant dilation of every glyph quad in em, added on the CPU when the quads are laid out. Zero leaves the work to the per-vertex dilation; the value luv used before dynamic dilation was 0.035.
Division of two represented quantities.
Subtraction or unary negation.
Test whether two compatible scalars are equal.
(camera distance lift)(camera)(device target-format string font-pathname shaped glyphs atlas center
world-units-per-em instance-data &key (label "world HarfBuzz Slug text"))Create one owned Slug draw batch from caller-positioned GLYPHS. The caller owns the semantic placement policy and supplies the dense instance records. This is the shared GPU boundary for ordinary shaped runs and the unified terminal surface in #7ZM22R.
(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
The maximum of compatible quantities.
(&key role (stage :fragment) vertex-role label device layout vertex-module
vertex-buffers target-format target-blend primitive depth-stencil)Create and install a live mathematical render pipeline. VERTEX-MODULE is borrowed when VERTEX-ROLE is NIL and STAGE is not :VERTEX. Every module compiled from ROLE or VERTEX-ROLE is owned by the returned artifact and retired on replacement or explicit release.
(arguments)(artifact)(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
(device glyph-cache camera target-format string font-pathname
&key (distance 8.0) (lift 3.0) (world-units-per-em 0.55))Shape STRING once and create a depth-tested world text run on DEVICE. The run owns dense placement/model data and its live pipeline; GLYPH-CACHE owns font-and-glyph device resources reusable across runs. See #QW7P96.
(cache font-pathname string &key direction)(shaped font-loader cache font-pathname)(draws shaped font-loader)(cache glyphs)(run device uniform-buffer)(run device string glyphs atlas instance-data)Publish one complete replacement instance population into RUN. The caller owns the semantic candidate. This function creates and fills its new GPU buffer before installing the new string, glyph, atlas, CPU-data, and buffer cohort. Native destruction of the predecessor remains submission-aware through the backend's…
Logical negation of one test or raw truth value.
The current implementation begins with ordinary authored voxel blocks of the dedicated terminal material. When exposed faces of those blocks form a maximal coplanar rectangular component, that rectangle has one derived terminal-surface identity. Its native chunk meshes remain the solid display body: the terminal…
Intent: cross #4G7064 from an isolated target into the actual luvcraft scene, with world placement, camera projection, scene depth, and alpha composition all participating in the same frame as terrain. make-world-text-run is now a semantic owner around dense HarfBuzz placement and vertex data. Its initial model…
HarfBuzz-shaped Slug text as world-owned render geometry.
A
world-text-runis the semantic placement boundary. A per-device cache retains HarfBuzz results and normalized outlines. Each distinct glyph set is packed into two device atlases and shared by matching runs.