lightmapTexture property

TextureSource? get lightmapTexture

Baked indirect diffuse light, in linear radiance unless lightmapRgbm is set. Null (the default) leaves the material lit by the environment alone.

A bound lightmap replaces the environment's spherical-harmonics diffuse ambient for this material rather than adding to it, so the baked bounce is not counted twice. Specular image-based lighting, the analytic lights, and occlusionTexture are unaffected.

Selects a shader variant that carries the lightmap sampler, so binding one costs a pipeline the first time it is drawn. Not available on transmissive materials.

Accepts a Texture2D or a RenderTexture (sampled live).

Implementation

// TODO(lightmap-serialization): carry the slot through the `.fscene` codecs
// (lib/src/fscene/realize/) and the editor's material copy, which round-trip
// every other texture slot.
TextureSource? get lightmapTexture => _lightmapTexture;
set lightmapTexture (TextureSource? value)

Implementation

set lightmapTexture(TextureSource? value) {
  if (identical(_lightmapTexture, value)) return;
  _lightmapTexture = value;
  _markMaterialDataDirty(variant: true);
}