Import
LightMapper is an addon, and must be imported explicitly, see Installation#Addons.
import { LightMapper } from 'three/addons/lighting/LightMapper.js';
Constructor
new LightMapper( renderer : WebGPURenderer, size : number, irradianceNode : function, options : Object )
Constructs a new light mapper.
| renderer |
The renderer. |
||
| size |
The light map size in texels. |
||
| irradianceNode |
Returns the irradiance for a world-space position, normal and sample index. |
||
| options |
Bake options.
|
Properties
.irradianceNode : function
The source of indirect irradiance.
.renderer : WebGPURenderer
The renderer.
.samples : number (readonly)
The number of accumulated samples.
Default is 0.
.size : number
The light map size in texels.
.texture : Texture
The baked light map. It stores linear diffuse irradiance in lux, without baked
albedo, material ambient occlusion, or display exposure, and uses uv1.
Values are not divided by pi, matching the runtime light map input.
Methods
.addObjects( objects : Array.<Mesh> )
Adds meshes to the light map. Their geometries must provide uv1.
Skinned and instanced meshes are not supported.
| objects |
The meshes to add. |
.dispose()
Frees all internal resources.
.reset()
Discards the accumulated samples.
.update( samples : number )
Accumulates samples into the light map.
| samples |
The number of samples to add. Default is |