Working with Light Sources in Three.js
In Chapter 1, Creating Your First 3D Scene with Three.js, you learned about the basics of Three.js, and in Chapter 2, The Basic Components that Make up a Three.js Application, we looked a bit deeper at the most important parts of the scene: the geometries, meshes, and cameras. You might have noticed that we skipped exploring the details of lights in that chapter, even though they make up an important part of every Three.js scene. Without lights, we won’t see anything rendered (unless we use basic or wireframe materials). Since Three.js contains several different light sources, each of which has a specific use, we’ll use this chapter to explain the various details of lights and prepare you for the upcoming chapters on material usage. By the end of this chapter, you’ll know the differences between the available lights and be able to choose and configure the correct light for your scene.
Note
WebGL itself doesn’t...