Chapter 4. Lighting

The earliest lighting algorithms used simple equations to render perfect Lambertian diffuse reflective surfaces and specular highlights. Complex illumination models such as ray tracing and radiosity, and programmable fragment shaders that simulate complex material reflectance properties, employ these simple diffuse and specular lighting equations as building blocks. In fact, simple diffuse and specular lighting suffice for the vast majority of nonphotorealistic interactive computer graphics applications today.

As a low-level graphics API, OpenGL has no direct support for ray tracing and radiosity. It does support ambient, diffuse, and specular lighting, however. This chapter describes how to set OpenGL lighting parameters ...

Get OpenGL® Distilled 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.