O'Reilly logo

Game Development with Three.js by Isaac Sukin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required