The paints of Cauldron3D.Paint in RGBA, four bytes a pixel, for a picture drawn in
full colour (Cauldron3D.Render.draw/3 with :palette).
An indexed texture's colours come from its own palette, or the picture's. Light 128 is
a texture's own colours; light scales red, green and blue alike, or each by its own
amount where a paint gives {r, g, b} light. A texel of the setup's clear index is
alpha 0, which the overlays leave out. A surface is an RGBA texture already lit.
A setup with a tint has each pixel's colour and alpha multiplied by it; where it also
has an alpha_test, a pixel whose own alpha is below the test is alpha 0 first.
{:warp, ...}'s :amplitude and :wavelength may each be {s, t}: the move along
s (by the sine of t) and the move along t (by the sine of s).
Besides Cauldron3D.Paint's paints:
{:skybox, faces}— a sky at no distance from six RGBA textures,facesa map with:front(looking along +x),:back,:left(+y),:right,:up(+z) and:down, each seen from inside the box with up toward +z (:upand:downwith their top toward +x){:lit, paint, lighting}—paint(with the setup's tint) and, added to it, the light of each oflighting.lights(%{origin:, radius:, colour: {r, g, b}}, and for a spot lightfov:in degrees withaxes: {forward, right, up}) on a flat surface of normallighting.normal: at the pixel's placepin a perspective view, withlthe light's origin lessp, each channel of the texel oflighting.textureat the paint's place pluslighting.offset(alpha 0 where it is colourlighting.clear) timesmax(normal · l / |l|, 0) * max(1 - |l|² / radius², 0)(times1 - x² - y²for a spot,xandybeingp's place across and up the light's view over its distance alongforwardtimestan(fov / 2), and nothing behind it) times the colour times the texel's alpha, each light's share held at 0 or above
Summary
Functions
A colour, a palette index or {r, g, b}, as RGBA bytes in context's palette.
The RGBA bytes of pixels first up to stop of row y, each multiplied by the
setup's tint there when it has one.
Functions
A colour, a palette index or {r, g, b}, as RGBA bytes in context's palette.
The RGBA bytes of pixels first up to stop of row y, each multiplied by the
setup's tint there when it has one.