Chapter 5. Color, Materials, and Lighting: The Basics

By Richard S. Wright, Jr.

WHAT YOU'LL LEARN IN THIS CHAPTER:

How To

Functions You'll Use

Specify a color in terms of RGB components

glColor

Set the shading model

glShadeModel

Set the lighting model

glLightModel

Set lighting parameters

glLight

Set material reflective properties

glColorMaterial/glMaterial

Use surface normals

glNormal

This is the chapter where 3D graphics really start to look interesting (unless you really dig wireframe models!), and it only gets better from here. You've been learning OpenGL from the ground up—how to put programs together and then how to assemble objects from primitives and manipulate them in 3D space. Until now, we've been laying the foundation, and you still can't tell what ...

Get OpenGL® SuperBible, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.