Chapter 6Thinking Outside the Box: Nonstock Shaders

by Richard S. Wright, Jr.

What You’ll Learn in this Chapter:

• How to write your own shaders that work with GLBatch

• About the different GLSL variable types

• About GLSL’s built-in functions

• How to roll your own lighting shaders

• How to use one- and two-dimensional textures in GLSL

• How to chisel out individual fragments

In Chapter 3, “Basic Rendering,” you were first introduced to shaders and how to use them. If you skipped it to get right into shader programming, you really need to review that chapter first and make sure you understand how we use attributes and uniforms, and how we pass them into a shader from our client-side code. In that chapter we focused our attention entirely on ...

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