# `Cauldron3D.Render`
[🔗](https://github.com/jaman/cauldron/blob/v0.2.2/cauldron_3d/lib/cauldron_3d/render.ex#L1)

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`)

# `draw`

```elixir
@spec draw(Cauldron3D.View.t(), [Cauldron3D.Polygon.t()], keyword()) ::
  Cauldron3D.Frame.t()
```

The polygons drawn as `view` sees them.

# `draw_setups`

```elixir
@spec draw_setups(Cauldron3D.View.t(), [Cauldron3D.Setup.t()], keyword()) ::
  Cauldron3D.Frame.t()
```

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

# `setups`

```elixir
@spec setups(Cauldron3D.View.t(), [Cauldron3D.Polygon.t()], keyword()) :: [
  Cauldron3D.Setup.t()
]
```

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
