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

A Review

Adding color to each vertex wasn’t so bad now that we have a basic framework in place. To do this, we added a new attribute to our vertex data and vertex shader, and we also told OpenGL how to read this data by using a stride. We then learned how to interpolate this data across the surface of a triangle by using a varying.

One important point to remember is that when we pass in our attribute data, we need to make sure to also pass in the right values for the component counts and the stride. If we get these wrong, we could end up with anything from a garbled screen to a crash.

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