Book Image

Three.js Cookbook

By : Jos Dirksen
Book Image

Three.js Cookbook

By: Jos Dirksen

Overview of this book

Table of Contents (15 chapters)
Three.js Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 5. Lights and Custom Shaders

In this chapter, we'll cover the following recipes:

  • Creating shadows with THREE.SpotLight

  • Creating shadows with THREE.DirectionalLight

  • Softening lights by adding ambient lighting

  • Using THREE.HemisphereLight for natural lighting

  • Adding a moving all-directional light

  • Moving a light source along a path

  • Making a light source follow an object

  • Creating a custom vertex shader

  • Creating a custom fragment shader