Lighting
Lights are instances of THREE.Light
that affect how the MeshLambertMaterial
and MeshPhongMaterial
surfaces are illuminated. Most lights have color (specified in hexadecimal notation like CSS colors) and intensity (a decimal value, usually between zero and one, indicating how bright the light should be). There are different kinds of lights as shown in the following table:
Type |
Constructor |
Description |
---|---|---|
Ambient |
THREE.AmbientLight(color) |
It affects all lit objects in the scene equally. |
Directional |
THREE.DirectionalLight(color, intensity = 1) |
For this type, all light is parallel and comes from a given direction, as if the source was very far away. |
Hemisphere |
THREE.HemisphereLight(skyColor, groundColor, intensity = 1) |
It simulates refractive lighting from the sun, sort of like two opposing directional lights. |
Point |
THREE.PointLight(color, intensity = 1, radius = 0) |
It emanates from a specific point in space, like a lightbulb. It illuminates only objects within |
Spot | ... |