Graphics Reference
In-Depth Information
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
Introduction
Three.js provides a large number of light sources out of the box. In this chapter, we'll
show you a number of recipes that work on lights and also show you how to get the
most out of the lighting options provided by Three.js. We'll also show you two ad-
vanced recipes that explain how you can access the raw features of WebGL by cre-
ating your own custom vertex and fragment shaders.
Search WWH ::




Custom Search