What are the light sources in three.js?
In Three.js, the light source has a base class of Three.light (hex), which accepts 16 binary colors as parameters to initialize the color of the light source, such as we want to define a green light source, which can be defined as:
var New Three. Light (0x00FF00);
And as the 3d engine three.js, this base class is difficult to meet our requirements, so we also need to inherit the base class of the more diverse light source:
In addition to this base class light source, we also have ambient light, area light, directional light, Spotlight, point Light, and so on. Below we introduce some common light sources.
(1) Ambient light
The environment is light that has been reflected many times , so it is impossible to determine its original orientation. It is a ubiquitous light whose light source can be thought to come from any direction. Therefore, when we set the scene light as ambient light, all objects will show the same degree of brightness, ambient light can be used three. Ambientlight to show that his constructor is three. Ambientlight (hex); , it still accepts 16 binary colors as parameters, as follows:
var New Three. Ambientlight (0xff00000); Scene.add (light);
As above, after adding the light source, the scene will be able to render the effect through the light source.
WebGL's multicolored light source