Chapter 2. Shader Fundamentals

Chapter Objectives

After reading this chapter, you’ll be able to do the following:

• Identify the various types of shaders that OpenGL uses to create images.

• Construct and compile shaders using the OpenGL Shading Language.

• Pass data into shaders using a variety of mechanisms available in OpenGL.

• Employ advanced GLSL shading capabilities to make shaders more reusable.

This chapter introduces shaders and explains how to use them with OpenGL. Along the way, we describe the OpenGL Shading Language (commonly called GLSL), and detail how shaders will influence your OpenGL applications.

This chapter contains the following major sections:

• “Shaders and OpenGL” discusses programmable graphics shaders in the context ...

Get OpenGL® Programming Guide: The Official Guide to Learning OpenGL®, Version 4.5 with SPIR-V, Ninth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.