# `CauldronGPU.Sectors.Light`
[🔗](https://github.com/jaman/cauldron/blob/v0.3.3/cauldron_gpu/lib/cauldron_gpu/sectors/light.ex#L2)

Sector light levels as a lightmap: one 256×1 texture holding the brightness of every
light level `0..255`, and the lightmap coordinates that read level `n` from it.

Brightness follows `Cauldron2D.Sectors.Light`'s ramp at a fixed viewing `distance`:
the share of full colour the light table at that distance keeps, turned from sRGB
into linear light.

    CauldronGPU.Sectors.Light.texture(256.0)
    CauldronGPU.Sectors.Light.uv(160)

# `brightness`

```elixir
@spec brightness(integer(), number()) :: float()
```

Linear brightness `0.0..1.0` of light `level` seen from `distance`.

# `texture`

```elixir
@spec texture(number()) :: CauldronGPU.Texture.t()
```

The lightmap texture of every light level seen from `distance` map units.

# `uv`

```elixir
@spec uv(integer()) :: {float(), float()}
```

The lightmap coordinates of light `level`, clamped to `0..255`.

---

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