Chapter 3. Working with the Different Light Sources Available in Three.js

In the first chapter, you learned about the basics of Three.js, and in the previous chapter, 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 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. Since Three.js contains a large number of lights, each of which has a specific use, we'll use this whole chapter to explain the various details of the lights and prepare you for the next chapter on material usage.

Note

WebGL itself doesn't have inherent support for lighting. Without Three.js, you would have ...

Get Learning Three.js – the JavaScript 3D Library for WebGL - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.