O'Reilly logo

Beginning WebGL for HTML5 by Brian Danchilla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 3

image

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.

9781430239963_Fig03-01.jpg

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required