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

Creating shadows with shadow mapping


In this recipe, we will bring more realism to scenes with shadows using a simple and widely accepted shadowing technique called shadow mapping to produce real-time shadows. This technique is called shadow mapping because it uses the depth information of the scene stored or mapped to a dynamically created depth buffer to produce real-time shadows.

This technique works in two passes:

  • First pass: During the first pass, a scene is rendered from the perspective of light. Here, the scene is viewed from the position of light in the 3D space. In this way, it's clear to figure out what objects fall under the path of light. In other words, it provides the information of objects that are directly visible from the perspective of light. The scene's depth information is recorded in a FBO texture; this texture is called the shadow map. Certainly, if a light ray from the position of light passes through one or more objects, the object with the higher depth (behind the...