Cauldron3D.Render (Cauldron3D v0.2.2)

Copy Markdown View Source

Draws polygons seen through a view into a Cauldron3D.Frame.

view = Cauldron3D.View.new(camera, {320, 200})
frame = Cauldron3D.Render.draw(view, polygons, light_table: colormap)

The picture is cut into bands of rows drawn at the same time, one per scheduler by default.

Options

  • :palette — 768 bytes of red, green and blue: draws the picture in full colour, four bytes a pixel (Cauldron3D.Paint.Rgba), indexed textures without their own palette taking their colours from this one
  • :light_table — rows of 256 colours, brightest first, for lit paints
  • :light_rows — how many rows the table has, default its size over 256
  • :background — the colour where no polygon is, default 0 (in full colour, a palette index or {r, g, b}, default black)
  • :backdrop — in full colour, a Cauldron3D.Frame of RGBA pixels the size of the picture, shown where no polygon is and blended under the see-through ones, instead of :background
  • :bands — how many bands to draw at once, default System.schedulers_online/0
  • anything else is passed on in the paint context (see Cauldron3D.Paint)

Summary

Functions

The polygons drawn as view sees them.

Prepared polygons drawn into a frame the size of view. Takes draw/3's options.

Polygons prepared for view, those that cannot be seen left out, set up in parallel.

Functions

draw(view, polygons, opts \\ [])

The polygons drawn as view sees them.

draw_setups(view, setups, opts \\ [])

Prepared polygons drawn into a frame the size of view. Takes draw/3's options.

setups(view, polygons, opts \\ [])

Polygons prepared for view, those that cannot be seen left out, set up in parallel.