Book Image

OpenGL ES 3.0 Cookbook

By : Parminder Singh
Book Image

OpenGL ES 3.0 Cookbook

By: Parminder Singh

Overview of this book

<p>"Write once, use anywhere" is truly the power behind OpenGL ES and has made it an embedded industry standard. The library provides cutting-edge, easy-to-use features to build a wide range of applications in the gaming, simulation, augmented-reality, image-processing, and geospatial domains.</p> <p>The book starts by providing you with all the necessary OpenGL ES 3.0 setup guidelines on iOS and Android platforms. You'll go on to master the fundamentals of modern 3D graphics, such as drawing APIs, transformations, buffer objects, the model-view-project analogy, and much more. The book goes on to deal with advanced topics and offers a wide range of recipes on the light shading, real-time rendering techniques with static and procedure textures to create stunning visualizations and runtime effects.</p>
Table of Contents (21 chapters)
OpenGL ES 3.0 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Render multiple objects with geometry instancing


The geometry instancing allows us to render multiple instances of the same object in a single rendering API call. These multiple instances differ in their generic attributes, such as transformation matrices, color, scale, and so on. This feature is very useful to implement particle systems, crowd simulation, rendering of jungle trees, and so on. Compared to the traditional way of rendering multiple objects that use multiple rendering calls, this technique is very efficient as it requires a single API call. This reduces the overhead of CPU processing in sending multiple rendering calls to the OpenGL ES rendering engine.

This recipe demonstrates the rendering of 1000 cubes using geometric instancing. For this, we will use 1000 matrices in a VBO. Each matrix contains a transformation to place a cube in the 3D space. The information of the matrices are updated using the range map buffer feature as discussed in the previous recipe. This allows us...