Interface: LightSettings
Defines a light source in the 3D scene.
The LightSettings interface configures how light illuminates products in the 3D scene. Lighting is crucial for creating mood, highlighting product features, and ensuring materials render correctly. Different light types and parameters create different visual effects, from dramatic spotlights to soft ambient illumination.
Strategic lighting can emphasize product details, create appropriate shadows, and enhance the perceived quality and dimensionality of 3D models.
Example
// Creating a warm key light from the upper right
const keyLight = {
name: "MainLight",
type: LightType.DIRECTIONAL,
intensity: 0.8,
position: [5, 8, 3],
direction: [-0.5, -0.8, -0.3],
color: [1, 0.98, 0.92], // Slightly warm white
shadowEnabled: true
};
// Adding a blue fill light for contrast
const fillLight = {
name: "FillLight",
type: LightType.POINT,
intensity: 0.4,
position: [-3, 1, -2],
color: [0.8, 0.9, 1], // Slightly cool blue
shadowEnabled: false
};
Properties
angle?
optionalangle?:number
Cone angle of the spot light in Radians. Used by Spot Light
autoCalcShadowZBounds?
optionalautoCalcShadowZBounds?:boolean
Automatically compute the shadowMinZ and shadowMaxZ for the projection matrix to best fit (including all the casters) on each frame. autoUpdateExtends must be set to true for this to work Used by Directional Light
autoUpdateExtends?
optionalautoUpdateExtends?:boolean
Automatically compute the projection matrix to best fit (including all the casters) on each frame. Used by Directional Light