LightmapBaker class final

Bakes a level's Lightmap from its brushes, offline: what dart run flutter3d_build:lightmap runs before a level ships.

A build step, not the simulation's. No step reads it and its output is committed beside the level; Lightmap, the format it writes, stays in flutter3d_sim beside the level document, where the loader reads it.

Constructors

LightmapBaker({double texelsPerMeter = 4.0, int bounces = 2, int samples = 64, int seed = 1, bool includeDirect = false, double texturedAlbedo = 0.5})
A baker of four texels per metre, two bounces of 64 rays per texel, seed 1, indirect light only, and a textured albedo of 0.5 unless given. Asserts bounces is not negative and samples is positive.
const

Properties

bounces → int
How many times light is allowed to bounce. Nought bakes nothing but the direct term, which with includeDirect off is an empty map.
final
hashCode → int
The hash code for this object.
no setterinherited
includeDirect → bool
Whether the direct light and its shadows go into the map as well.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
samples → int
Rays per texel per bounce.
final
seed → int
Mixed with each texel's index to seed that texel's ray directions: the same seed bakes the same bytes, another one different noise.
final
texelsPerMeter → double
The map's density: texels per metre of face.
final
texturedAlbedo → double
What a textured material reflects, since the bake does not read the texture: a mid grey, scaled by the material's colour. A 0..1 albedo.
final

Methods

bake(Level authored, {LightmapLayout? layout, void log(String message)?}) → Lightmap
Bakes level. log hears each stage as it completes; the caller keeps the clock, since this package reads none.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited