CauldronGPU.Sectors.Light (CauldronGPU v0.3.3)

Copy Markdown View Source

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)

Summary

Functions

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

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

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

Functions

brightness(level, distance)

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

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

texture(distance)

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

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

uv(level)

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

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