How a polygon's pixels get their colours.
{:flat, colour}— one colour{:texture, texture, light}— aCauldron3D.Texturerepeated across the polygon by itsuvs, through the light table atlight(0 to 255, 128 the texture's own colours), or as it is whenlightisnil{:shaded, texture}— as:texture, the light carried across from the polygon'slights{:surface, texture}— a texture already lit, its edge pixels repeated beyond it{:warp, texture, opts}— a texture rippling as liquid does: each place on it moved by:amplitudepixels (default 8.0) along a sine of the other axis, of:wavelengthpixels (default 128.0), moving with:timeseconds at:speed(default 1.0) turns a second;:lightas:texture's, defaultnil{:sky, layers, opts}— a sky at no distance:layersis a list of{texture, speed}, nearest first, each drawn where the one before is colour:clear(default 0) and movingspeedpixels a second with:time;:scale(default 378.0) is how far across the sky a view straight ahead reaches, and:flatten(default 3.0) squashes it toward the horizon{:fun, fun}—fun.(first, stop, y, setup, context)returns thestop - firstcolours of the run itself
The context is a map: :light_table (rows of 256 colours, brightest first),
:light_rows (how many rows it has), :background (the colour behind every polygon),
and :view, which {:sky, ...} reads. Light value v uses row
(255 - v) * light_rows / 256, held inside the table.
Summary
Functions
The light table row for light value light (0 to 255, brighter higher).
The colours of pixels first up to stop of row y, as a binary: a byte a pixel, or
in a full-colour picture (a context with :rgba) four, as Cauldron3D.Paint.Rgba
paints them.
Types
Functions
@spec light_row(number(), context()) :: non_neg_integer()
The light table row for light value light (0 to 255, brighter higher).
The colours of pixels first up to stop of row y, as a binary: a byte a pixel, or
in a full-colour picture (a context with :rgba) four, as Cauldron3D.Paint.Rgba
paints them.