Textures and Lighting

In this chapter we will cover two topics that are fundamental to producing realistic scenes, texture and lighting. Specifically, we will

  • discuss what textures are and how to apply them
  • show what texture options are available and how to configure these
  • use multiple textures in a shader
  • present a basic lighting model
  • create a directional light shader

By the end of the chapter, we will produce the textured and lit mesh on the right of Figure 3-1.


Figure 3-1 . Left - No texture or lighting; Right - both texture and ...

Get Beginning WebGL for HTML5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.