Chapter 4. Shaders and Programs

Chapter 2, “Hello, Triangle: An OpenGL ES 3.0 Example,” introduced you to a simple program that draws a single triangle. In that example, we created two shader objects (one for the vertex shader and one for the fragment shader) and a single program object to render the triangle. Shader objects and program objects are fundamental concepts when working with shaders in OpenGL ES 3.0. In this chapter, we provide the full details on how to create shaders, compile them, and link them together into a program object. The details of writing vertex and fragment shaders come later in this book. For now, we focus on the following topics:

• Shader and program object overview

• Creating and compiling a shader

• Creating and ...

Get OpenGL ES 3.0 Programming Guide, Second 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.