luvcraft/agent/cat-shaders.lisp
World cells per cat figure unit; the sitting cat is 1.30 units high.
The cat's head radius in figure units.
How high the ear tips stand above the cat's paws, in figure units.
How far the question-mark tail sweeps out from the cat's side.
The angular radius of the cat's green eyes on its head.
The tabby coat's vertical stripe frequency in figure space.
How strongly the tabby stripes darken the orange coat.
The warm edge light separating the cat from the world behind it.
Construct a meaningful literal.
Compare compatible quantities and produce dimensionless values.
((name symbol) (type (eql 'arithmetic-operator)))(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…
(name parameters &body body)Define a reusable typed shader expression with ordinary source syntax. The body is parsed at each call site, so argument types and quantity meanings flow through the same operator protocol as handwritten shader expressions. LET* is lexical inside the function. The definition macro records source; its body does not…
Subtraction or unary negation.
Constrain a quantity between compatible bounds.
Division of two represented quantities.
The inner product of two vectors.
The maximum of compatible quantities.
Multiplication and scalar scaling.
The usual bounded approximation to an ellipsoid's signed distance. Exact would need a quartic root; this under-estimates, which is all sphere tracing asks of it.
The componentwise absolute value of a raw value.
Select and reorder vector components by a designator such as :XYZ or :RGB.
The polynomial smooth minimum: a union with a fillet of RADIUS. This is what makes a nose grow out of a face instead of intersecting it.
A cone capped by a sphere at each end: the shape of a robe, and of a hat. The lateral surface is tangent to both caps, so the silhouette has no crease where the cone meets its rounding.
Normalize a dimensionless vector.
Addition over compatible quantities.
Produce dimensionless progress across compatible edges.
Interpolate compatible quantities by a scalar amount.
The minimum of compatible quantities.
Raise a dimensionless value to a dimensionless power.
(generic-function name specialized-lambda-list options &body body)Define a shader-producing method with ordinary DEFMETHOD identity. Calling the method reparses its small source form so changes to source-level abstractions participate in live rebuilding. Method replacement remains the role/stage identity watched by the MOP; abstraction revisions are tracked separately by live…
(role stage)Return the current durable shader specification for ROLE and STAGE.
Expose a quantity's raw representation.
The componentwise square root of a raw value.
Test whether one compatible scalar is greater than another.
The cat agent's analytic body. Like the gnome, a conservative billboard only launches rays; the visible animal is the zero set of this field.