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 ambient light component


The ambient light illuminates the object's surface equally in all directions on which it's applied. All faces receive an equal amount of light; therefore, no change in color can be observed on the complete object. Ambient is basically a mixture of two components: the color intensity of light and material.

Note

Mathematically, this is the product ambient light (La) and ambient material (Ka).

Ia = LaKa

An ambient light plays a vital role in Phong and Gouraud shadings; the diffuse and specular color components of these shadings are computed by using the direction of the light that falls on the object. Therefore, an object may receive less or no light on its side or back faces depending on the direction of light on the object. In such cases, the faces may appear invisible because of the black light that is generated; choosing the correct ambient light and material color will help in making these darkened faces visible.

Getting ready

This chapter...