Chapter 17. Fragment Shading: Empower Your Pixel Processing

by Benjamin Lipchak

WHAT YOU’LL LEARN IN THIS CHAPTER:

How to alter colors

How to post-process images

How to light an object per-fragment

How to perform procedural texture mapping

As you may recall from Chapter 15, “Programmable Pipeline: This Isn’t Your Father’s OpenGL,” fragment shaders replace the texturing, color sum, and fog stages of the fixed functionality pipeline. This is the section of the pipeline where the party is happening. Instead of marching along like a mindless herd of cattle, applying each enabled texture based on its preordained texture coordinate, your fragments are free to choose their own adventure. Mix and match textures and texture coordinates. Or calculate ...

Get OpenGL SuperBible: Comprehensive Tutorial and Reference, Fourth 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.