Interface: LightRig
Experimental
The lights of scene.lighting for a 3D scene. Add object to the scene, call attach once with the renderer (shadow maps, environment), and setCamera with the scene's camera (lights in camera or clip space follow it). Set the rig on meshes drawn with Plotly's model (MeshPrimitive.setLightRig) so they use the same lights.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
object | readonly | Group | Experimental three.js lights (and the ground plane): add to the scene. |
Accessors
environment
Get Signature
get environment(): Texture<unknown, TextureEventMap> | null;Experimental
The scene's environment texture (or null), once available.
Returns
Texture<unknown, TextureEventMap> | null
spec
Get Signature
get spec(): Readonly<LightingSpec>;Experimental
The current spec.
Returns
Readonly<LightingSpec>
Methods
attach()
attach(
renderer,
scene,
invalidate?
): void;Experimental
Bind to the renderer and scene: enables shadow maps when a light casts shadows and sets the scene's environment. invalidate is called when an environment image has loaded.
Parameters
| Parameter | Type |
|---|---|
renderer | WebGLRenderer |
scene | Scene |
invalidate? | () => void |
Returns
void
dispose()
dispose(): void;Experimental
Returns
void
restore()
restore(): void;Experimental
Draw again what only existed on the GPU, after the WebGL context was lost and restored: the generated environment ('studio', 'city') is a render target, which three.js cannot upload again as it does buffers and textures.
Returns
void
setCamera()
setCamera(camera): void;Experimental
The camera that camera- and clip-space lights follow.
Parameters
| Parameter | Type |
|---|---|
camera | Camera | null |
Returns
void
update()
update(spec): void;Experimental
Replace the lights.
Parameters
| Parameter | Type |
|---|---|
spec | LightingSpec |
Returns
void