Import
LightProbeGrid is an addon, and must be imported explicitly, see Installation#Addons.
import { LightProbeGrid } from 'three/addons/lighting/LightProbeGrid.js';
Constructor
new LightProbeGrid( width : number, height : number, depth : number, widthProbes : number, heightProbes : number, depthProbes : number )
Constructs a new irradiance probe grid.
The volume is centered at the object's position.
| width |
Full width of the volume along X. Default is |
| height |
Full height of the volume along Y. Default is |
| depth |
Full depth of the volume along Z. Default is |
| widthProbes |
Number of probes along X. Defaults to |
| heightProbes |
Number of probes along Y. Defaults to |
| depthProbes |
Number of probes along Z. Defaults to |
Properties
.boundingBox : Box3
The world-space bounding box for the grid. Updated automatically by LightProbeGrid#bake.
.depth : number
The full depth of the volume along Z.
.height : number
The full height of the volume along Y.
.isLightProbeGrid : boolean (readonly)
This flag can be used for type testing.
Default is true.
.resolution : Vector3
The number of probes along each axis.
.texture : Data3DTexture
The single RGBA atlas 3D texture storing all seven packed SH sub-volumes.
Default is null.
.width : number
The full width of the volume along X.
Methods
.bake( renderer : WebGLRenderer, scene : Scene, options : Object )
Bakes all probes by rendering cubemaps at each probe position and projecting to L2 SH. Fully GPU-resident with zero CPU readback.
| renderer |
The renderer. |
||||||
| scene |
The scene to render. |
||||||
| options |
Bake options.
|
.dispose()
Frees GPU resources.
.getProbePosition( ix : number, iy : number, iz : number, target : Vector3 ) : Vector3
Returns the world-space position of the probe at grid indices (ix, iy, iz).
| ix |
X index. |
| iy |
Y index. |
| iz |
Z index. |
| target |
The target vector. |
- Returns: The world-space position.
.updateBoundingBox()
Updates the world-space bounding box from the current position and size.