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

Implementing the per-vertex diffuse light component


Diffuse light comes from a particular direction and is reflected in various directions after collision with the surface of the object. In this section, we model this behavior by using the Phong Reflection Model, which was developed by Bui Tuong Phong in 1973. This model proposed an illumination shading technique that uses a normal surface and the direction of incident light. When light strikes on an object's surface, some of its parts are reflected and the rest is partially absorbed. Therefore, we can calculate either the intensity of light absorbed or reflected, if one of the components is given.

Note

Total light intensity = reflection light intensity + absorption light intensity

When 100 percent light intensity falls on a plain surface and 50 percent of it is reflected, it's obvious that 50 percent of light intensity is being absorbed or lost in the surroundings. In 3D graphics, we are only concerned with the reflected light intensity because...