Cauldron3D.Raster (Cauldron3D v0.2.2)

Copy Markdown View Source

Draws prepared polygons (Cauldron3D.Setup) into rows of pixels.

Each row keeps the runs of pixels where one polygon is nearest; a polygon added to the row takes the pixels where it is nearer than what is there, found from its :near plane, so every pixel is painted once, by the polygon in front, whatever order the polygons come in. Where two are equally near the one added first keeps the pixel. See-through, blended and always-on-top setups (Cauldron3D.Setup.overlay?/1) are painted after, over the row: first the unblended, in the order given, each pixel taken where it is nearer than what is there and its alpha passes, keeping its own nearness; then the blended, in the order given, mixed over what is there where they are nearer, leaving the nearness as it was. In a picture in full colour the depth test reads the nearness of every overlay already drawn; in an indexed picture only that of the runs.

Cauldron3D.Raster.rows(setups, 0..199, width, paint_context)
#=> binary of 200 rows

Summary

Functions

The pixels of rows (a range of row numbers) in a picture width wide, every row in turn, with context handed to Cauldron3D.Paint.span/6.

The visible runs of row y, left to right, as {first, last, setup}.

Types

Functions

rows(setups, arg, width, context)

The pixels of rows (a range of row numbers) in a picture width wide, every row in turn, with context handed to Cauldron3D.Paint.span/6.

runs(setups, y, width)

@spec runs([Cauldron3D.Setup.t()], integer(), pos_integer()) :: [run()]

The visible runs of row y, left to right, as {first, last, setup}.