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

Sphere illusion with textured quadrilateral


This recipe will demonstrate a performance efficient technique, which makes use of the procedural texture to produce the illusion of a real 3D object. In the Gouraud shading, fragments are painted with light shadings based on the direction of the light source and the geometry shape. For instance, in Chapter 5, Light and Materials, we implemented the diffuse light on a spherical model, which contains a very high number of vertices. This recipe technique renders the same diffused sphere, but using only four vertices. It fakes the light shading in such a way that the difference between the two becomes indistinguishable.

The performance is directly proportional to the number of fragments it renders to the screen. For example, the surface area covered by a single fullscreen rendering sphere is equivalent to several tiny spheres covering up the same surface area on the screen.

How to do it...

Use the following steps to implement sphere with textured quadrilateral...