luft/render/flame-shaders.lisp
The authored material supplies hue and baseline HDR strength. Heat is a
dimensionless scalar response, not a second hidden rgb palette.
The one exact 24-bit float lane is shared by both renderers. Keeping the material and sampled light beside the realized frame makes flame and body publication one immutable transaction instead of two index-coupled sidecars.
Pack a 12-bit material assembly and RGB4 voxel light into frame FLAGS.
Return the assembly id and packed RGB4 voxel light encoded by flags.
Validate one three-Vec4 torch frame in data starting at offset.
The normal and tangent must already be unit length and mutually orthogonal.
FLAGS is an exactly represented nonnegative integer in the normal row's W
lane, SEED is in [0,1), and scale is strictly positive. Return data.
Pack and validate one arbitrary realized torch frame as three Vec4 rows.
Return origin, seed, normal, flags, tangent, and scale for one frame.
Return face's stable animation seed without realizing a surface frame.
Return the flame material's authored linear HDR radiance as three values.
Return one float32 Vec4 holding current time and authored linear HDR rgb.
The rgb lanes are the flame material's base tone times its surface emission.
The caller owns the clock; this interface never consults wall time, so captures
and CPU/GPU comparisons can replay the flame effect exactly.
B = N x T, hence T x B = N for the validated orthonormal pair.
Project world up into the actual surface tangent plane. Its length continuously replaces the old axis-specific wallness switch.
Evaluate the scalar flame envelope used by the GPU at one world point.
Evaluate the animated scalar extinction density at one world point.
Return the fixed-sample premultiplied HDR rgba flame integral along RAY.
maximum-path-length, when supplied, clips the proxy chord to the visible
distance in front of opaque scene depth. It is clamped to the canonical proxy
chord exactly as the fragment shader does, so zero is a deterministic empty
integral and callers can compare full, partial, and fully occluded rays.
Canonical torch body
This is deliberately an expanded triangle stream rather than another semantic mesh. Each vertex is two Vec4 rows: local position plus its barycentric selector, then the flat local normal plus a boundary-edge mask. The attachment frame is the only world-space placement representation.
Faceting comes from the actual face normals. Internal triangle diagonals are not semantic construction edges.
Return the canonical expanded triangle vertex count for one torch body.
Return a fresh float32 copy of the canonical two-Vec4-per-vertex body.
Transform one canonical body vertex through arbitrary realized frame.
Return world position, normalized world normal, barycentric selector, and boundary-edge mask. This is the scalar oracle for both body vertex shaders.
B=NxT, so local X/Y/Z map to a right-handed T/B/N frame.
This interface intentionally matches mesh-fragment-specification
exactly, including interpolation qualifiers.
Procedural radiance is a post-temporal composite. Rasterize the stable, unjittered proxy and never author a motion/history footprint for it.
Opaque depth was rendered with the current projection jitter while this post-temporal proxy is deliberately stable. Four nearest taps conservatively choose the closest covered internal pixel at an edge, avoiding bright half-flames leaking through a bevel silhouette.
(assembly-id packed-voxel-light)Logical conjunction of tests and raw truth values.
Test whether two compatible scalars are equal.
Test whether one compatible scalar is at most another.
Extract the unsigned bit field (BYTE SIZE POSITION) of one unsigned scalar.
The componentwise absolute value of a raw value.
(data &optional (offset 0))Validate one three-Vec4 torch frame in DATA starting at OFFSET. The normal and tangent must already be unit length and mutually orthogonal. FLAGS is an exactly represented nonnegative integer in the normal row's W lane, SEED is in [0,1), and SCALE is strictly positive. Return DATA.
Multiplication and scalar scaling.
Addition over compatible quantities.
Test whether one compatible scalar is less than another.
Subtraction or unary negation.
(origin-x origin-y origin-z seed
normal-x normal-y normal-z flags
tangent-x tangent-y tangent-z scale)(data &optional (offset 0))(tick-x tick-y tick-z)(site)(site)(site)(site)(site)Logical negation of one test or raw truth value.
(time)Return one float32 Vec4 holding current time and authored linear HDR RGB. The RGB lanes are the flame material's base tone times its surface emission. The caller owns the clock; this interface never consults wall time, so captures and CPU/GPU comparisons can replay the flame effect exactly.
(value low high)(low high value)(value)The maximum of compatible quantities.
The minimum of compatible quantities.
Division of two represented quantities.
(instance point-x point-y point-z time)The componentwise square root of a raw value.
(instance point-x point-y point-z time)(instance point-x point-y point-z time)(instance origin-x origin-y origin-z ray-x ray-y ray-z time
&key maximum-path-length)Return the fixed-sample premultiplied HDR RGBA flame integral along RAY. MAXIMUM-PATH-LENGTH, when supplied, clips the proxy chord to the visible distance in front of opaque scene depth. It is clamped to the canonical proxy chord exactly as the fragment shader does, so zero is a deterministic empty integral and…
Sample a two-dimensional texture through a sampler at a UV coordinate.
(radius angle height)(data point-a point-b point-c expected-normal)The non-negative remainder of integer division.
(frame vertex-index)Transform one canonical body vertex through arbitrary realized FRAME. Return world position, normalized world normal, barycentric selector, and boundary-edge mask. This is the scalar oracle for both body vertex shaders.
An explicitly owned AVFrame.
(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…
Select and reorder vector components by a designator such as :XYZ or :RGB.
Normalize a dimensionless vector.
(name options &body body)Define NAME as a function that reparses its shader source on every call. Where DEFINE-SHADER parses once at load, this parses each time it is asked, so live named values (SHADER-SOURCE-VALUE) folded into the body are read afresh -- and noted in *SHADER-SOURCE-VALUE-REFERENCES* -- by every pipeline build, exactly as a…
Convert one scalar float or unsigned value to a 32-bit unsigned integer.
Read one indexed element of a storage buffer resource.
Convert one scalar float or unsigned value to a 32-bit float.
The inner product of two vectors.
Test whether one compatible scalar is greater than another.
Constrain a quantity between compatible bounds.
Produce dimensionless progress across compatible edges.
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. Its authored light generation contains…
Animated torch-flame substrate
A torch remains a sparse semantic attachment, while its rendered body and flame share one frame realized against the final surface. The GPU boundary is deliberately plain: three Vec4 rows containing origin/seed, normal/flags, and tangent/scale. Its CPU functions are scalar references for the shader field and integral rather than a second retained representation.