Chapter 12Adding Terrain

Now that we have a nice backdrop with some stormy clouds on the horizon, it’s time for us to start adding in some substance to our world. In this chapter, we’ll learn how to use a height map to add some terrain to the scene. As we do this, we’ll touch many new areas of OpenGL and learn how to use the depth buffer for preventing overdraw, and we’ll also learn how to store vertex and index data directly on the GPU for better performance.

Height maps are an easy way to add terrain to a scene, and they can easily be generated or edited using a regular paint program. The depth buffer itself is a fundamental part of OpenGL, and it helps us easily render more complex scenes without worrying too much about how that scene is ...

Get OpenGL ES 2 for Android 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.