Book Image

Learning Three.js - the JavaScript 3D Library for WebGL

By : Jos Dirksen
Book Image

Learning Three.js - the JavaScript 3D Library for WebGL

By: Jos Dirksen

Overview of this book

Table of Contents (20 chapters)
Learning Three.js – the JavaScript 3D Library for WebGL Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
8
Creating and Loading Advanced Meshes and Geometries
Index

Different kinds of lighting provided by Three.js


There are a number of different lights available in Three.js that all have specific behavior and usages. In this chapter, we'll discuss the following set of lights:

Name

Description

THREE.AmbientLight

This is a basic light, the color of which is added to the current color of the objects in the scene.

THREE.PointLight

This is a single point in space from which light spreads in all directions. This light can't be used to create shadows.

THREE.SpotLight

This light source has a cone-like effect like that of a desk lamp, a spot in the ceiling, or a torch. This light can cast shadows.

THREE.DirectionalLight

This is also called infinite light. The light rays from this light can be seen as parallel, like, for instance, the light from the sun. This light can also be used to create shadows.

THREE.HemisphereLight

This is a special light and can be used to create more natural-looking outdoors lighting by simulating a reflective surface...