lights
Allows a material to be affected only by a manually specified list of lights, overriding the default behavior of receiving light from all sources in the scene.
Core Advantages
Provides extreme performance optimization (by reducing light calculations for specific objects) and artistic control (like creating character-specific lighting that doesn't affect the environment).
Common Uses
Creating dedicated lighting rigs for characters (key, fill, rim lights).
Optimizing performance in large scenes by reducing light calculations for distant or static objects.
Making lightmapped objects ignore all real-time lights by passing an empty array `lights([])`.
Implementing interactive highlighting effects by dynamically adding a temporary light to an object.
How to adjust
Adjusted by modifying the light array passed in from JavaScript. For example, calling `myLightsNode.setLights([newLight])` will cause the material to instantly ignore its old lights and be lit only by `newLight`, enabling dynamic lighting changes and interactivity.
Code Examples
1// In the lighting context, specify this material is only lit by myLight1 and myLight2
2lightingContext( lightingModel, {
3 lights: lights( [ myLight1, myLight2 ] )
4} );