O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

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

Linking Shaders Together into an OpenGL Program

Now that we’ve loaded and compiled a vertex shader and a fragment shader, the next step is to bind them together into a single program.

Understanding OpenGL Programs

An OpenGL program is simply one vertex shader and one fragment shader linked together into a single object. Vertex shaders and fragment shaders always go together. Without a fragment shader, OpenGL wouldn’t know how to draw the fragments that make up each point, line, and triangle; and without a vertex shader, OpenGL wouldn’t know where to draw these fragments.

We know that the vertex shader calculates the final position of each vertex on the screen. We also know that when OpenGL groups these vertices into points, lines, and triangles ...

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