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 directional and point light


Light can be divided into three types, namely point light, directional light, and spot light. Let's take a look in detail:

  • Point light or positional light: This type of light comes from a fixed position in the 3D space. The position of light and vertices of the object on which it falls is used to calculate the direction of the light. Point light emits light in all directions. Each vertex can have different directions of light, depending on its position from the light source, as shown in the following image.

  • Directional light: This type of light is a special case of the point light. Here, the direction of the light falling on the object is considered as nonvarying. This means that the direction of all the light rays are parallel. In directional light, the light source is considered infinitely far from the model, on which it's supposed to fall. Sometimes, it's better to assume the light direction to be parallel during the 3D scene rendering process. This...