Skip to content

BakeOptions

Defined in: sdk/src/lightmap/bake.ts:24

Bakes lights into an atlas a MeshLightmap reads. Direct light, then what bounced — the term a frame here cannot compute, and the way past its ceiling of sixteen lights.

Pre-1.0: the options will follow what an authoring panel needs.

optional ambient?: readonly [number, number, number]

Defined in: sdk/src/lightmap/bake.ts:39

The sky’s radiance where no sky is given: the same from every direction, and still only reaching what can see it.


optional atlasSize?: number

Defined in: sdk/src/lightmap/bake.ts:26

Side of the square atlas, in texels.


optional bounces?: number

Defined in: sdk/src/lightmap/bake.ts:34

How many times light is allowed to reflect. Zero is direct light only — useful, because past the sixteen a frame can carry it is still the answer.


optional dilate?: number

Defined in: sdk/src/lightmap/bake.ts:46

Texels the solved edges are smeared outwards, so a bilinear tap near a chart’s border does not read the empty atlas beside it.


optional occluders?: readonly BakeSurface[]

Defined in: sdk/src/lightmap/bake.ts:57

What stands in the light and holds none of it: geometry with no lightmap UV set (lit by probes when the game runs). It shadows the surfaces and hides the sky from the probes; a ray that meets it finds it unlit.


optional probeGrids?: readonly ProbeGrid[]

Defined in: sdk/src/lightmap/bake.ts:50

Grids of probes to solve in the same light field — what lights the things a bake cannot hold still. Solved after the surfaces, because a probe gathers what they ended up giving off.


optional probeSamples?: number

Defined in: sdk/src/lightmap/bake.ts:60

Directions each probe gathers. Over the whole sphere, so this buys less per ray than a lumel’s hemisphere does.


optional reflectionProbes?: readonly (readonly [number, number, number])[]

Defined in: sdk/src/lightmap/bake.ts:63

Where reflections are captured from — a panorama each, solved in the same light field the probes are. The specular half of the same question.


optional reflectionSky?: SkyRadiance

Defined in: sdk/src/lightmap/bake.ts:70

What a captured ray brings back when it escapes the scene. The environment where the caller could sample one, the flat ambient where it could not.


optional reflectionWidth?: number

Defined in: sdk/src/lightmap/bake.ts:67

Width of a captured panorama; its height is half. Small on purpose: what a rough surface reflects is a blur, and the prefilter below widens the lobe anyway.


optional samples?: number

Defined in: sdk/src/lightmap/bake.ts:36

Rays each lumel gathers per bounce.


optional sky?: SkyRadiance | SkySpec

Defined in: sdk/src/lightmap/bake.ts:43

What a lumel or a probe receives along a ray that escapes the scene — the environment as the frame lights by it, tint and turn included. A bake split across threads needs it as data.


optional skyOcclusion?: boolean

Defined in: sdk/src/lightmap/bake.ts:54

Bake the probes WITHOUT the sky, and how much of it each sees: the frame then lights them with the sky it has (a live Sky Atmosphere, a weather) seen through that, so a room stays dark under a sky that changes. Off, the probes hold the sky as it was at the bake.


optional texelsPerUnit?: number

Defined in: sdk/src/lightmap/bake.ts:31

How finely a surface is lit, in texels per world unit. A world unit here is a DESIGN PIXEL, so a room is hundreds of units across and a lumel every few of them is already fine — a density borrowed from an engine whose unit is a metre would ask for an atlas no scene could fit.