O'Reilly logo

OpenGL® ES 2.0 Programming Guide by Dave Shreiner, Dan Ginsburg, Aaftab Munshi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Shaders and Programs

In Chapter 2, “Hello, Triangle: An OpenGL ES 2.0 Example,” we 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 in working with shaders in OpenGL ES 2.0. In this chapter, we introduce you to 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 the book. For now, we focus on:

  • Shader and program object overview.

  • Creating and compiling a shader.

  • Creating and linking a program. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required