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

Softening the shadow edges using PCF


PCF stands for percentage-closer filtering. It is a well-known and simple technique to produce smooth shadow edges. The shadow mapping technique implemented in the previous recipe shows very sharp transitions among light and shadow pixels, thereby producing aliasing effects. The PCF technique averages these sharp transitions and results in smoother shadows. Unlike the other texture that provides the capability for texture filtering, which is basically a smoothening method to determine the color of a texture-mapped pixel, unfortunately, such filtering techniques cannot be applied to shadow mapping. Alternatively, multiple comparisons are made per pixels and averaged together.

As the PCF name depicts, it samples the shadow map using the current fragment and compares it with surrounding samples. The rule is to give more weightage to samples closer to the light source. In order words, it calculates the percentage of the area closer to the illuminated surface...