Lights
by Lea Rosema
Three.js provides several classes to add light to your scene, based on the abstract classes Light
or LightProbe
Light vs LightProbe
anchorLight probes are an alternative way of adding light to 3D scenes.
In contrast to Light
, a LightProbe
doesn't emit light directly and is usually generated by environment maps.
AmbientLight
anchorAmbientLight
globally illuminates all objects in the scene equally.
- No direction, cannot be used to cast shadows
- also available as LightProbe:
AmbientLightProbe
DirectionalLight
anchorLight that gets emitted in a specific direction. It will behave as it is infinitely far away. Light rays are all cast in parallel. This is like the sun.
This light can cast shadows, see DirectionalLightShadow for details.
HemisphereLight
anchorHemisphereLight
is a light source positioned directly above the scene.
- light is fading from a
skyColor
togroundColor
- no direction
- cannot be used to cast shadows
- also available as LightProbe class:
HemisphereLightProbe
PointLight
anchorPointLight
emits light from a single point in all directions.
- Common use case: light bulb.
- can cast shadows, see PointLightShadow
SpotLight
anchorSpotLight
emits from a single point alonng a cone.
- can cast shadows, see SpotLightShadow
RectAreaLight
anchorRectAreaLight
emits light across the face a rectangular plane.
- can be used to simulate light sources such as bright windows
- no shadow support
- only
MeshStandardMaterial
andMeshPhysicalMaterial
are supported - additional include needed:
ReactAreaLightUniformsLib