You are previewing OpenGL ES 3.0 Cookbook.
O'Reilly logo
OpenGL ES 3.0 Cookbook

Book Description

Over 90 ready-to-serve, real-time rendering recipes on Android and iOS platforms using OpenGL ES 3.0 and GL shading language 3.0 to solve day-to-day modern 3D graphics challenges

In Detail

"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.

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.

What You Will Learn

  • Learn the essentials and exciting new features of OpenGL ES 3.0

  • Discover the physics behind fundaments of light and material concepts with easy-to-follow examples

  • Scratch the fragments with procedural shaders and learn how they work

  • Master the basics of texturing, use compressed textures, and learn numerous mapping techniques

  • Manage complex scenes with scene graphs and learn post-processing and image-processing techniques

  • Build your font engine with multilingual support

  • Master the working of recognized anti-aliasing techniques and implement FXAA and adaptive anti-aliasing

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. OpenGL ES 3.0 Cookbook
      1. Table of Contents
      2. OpenGL ES 3.0 Cookbook
      3. Credits
      4. About the Author
      5. Acknowledgments
      6. About the Reviewers
      7. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      8. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      9. 1. OpenGL ES 3.0 on Android/iOS
        1. Introduction
        2. Programming shaders in OpenGL ES shading language 3.0
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        3. Loading and compiling a shader program
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Linking a shader program
          1. How to do it...
          2. How it works...
          3. See also
        5. Checking errors in OpenGL ES 3.0
          1. How to do it...
          2. How it works...
        6. Using the per-vertex attribute to send data to a shader
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Using uniform variables to send data to a shader
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Programming OpenGL ES 3.0 Hello World Triangle
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        9. Using JNI on Android to communicate with C/C++
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        10. Developing an Android OpenGL ES 3.0 application
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        11. Developing an iOS OpenGL ES 3.0 application
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      10. 2. OpenGL ES 3.0 Essentials
        1. Introduction
        2. Building prototypes using the GLPI framework
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        3. Implementing touch events
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Rendering primitives with vertex arrays
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        5. Drawing APIs in OpenGL ES 3.0
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Efficient rendering with Vertex Buffer Object
          1. How to do it...
          2. How it works...
        7. Transformations with the model, view, and projection analogies
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        8. Understanding the projection system in GLPI
          1. How to do it...
          2. How it works...
        9. Culling in OpenGL ES 3.0
          1. How to do it...
          2. How it works...
        10. Depth testing in OpenGL ES 3.0
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      11. 3. New Features of OpenGL ES 3.0
        1. Introduction
        2. Managing variable attributes with qualifiers
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Grouping uniforms and creating buffer objects
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Managing VBO with Vertex Array Objects
          1. How to do it...
          2. How it works...
          3. See also
        5. Reading and writing buffer objects with mapping
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Render multiple objects with geometry instancing
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        7. Rendering multiple primitives with primitive restart
          1. Getting ready
          2. How to do it...
          3. There's more...
          4. See also
      12. 4. Working with Meshes
        1. Introduction
        2. Creating polygon meshes with Blender
          1. Getting ready
          2. How to do it...
          3. There's more...
          4. See also
        3. Rendering the wavefront OBJ mesh model
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Rendering the 3Ds mesh model
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      13. 5. Light and Materials
        1. Introduction
        2. Implementing the per-vertex ambient light component
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Implementing the per-vertex diffuse light component
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Implementing the per-vertex specular light component
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Optimizing the specular light with the halfway vector
          1. How to do it...
          2. How it works...
          3. See also
        6. Gouraud shading – the per-vertex shading technique
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Phong shading – the per-fragment shading technique
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        8. Implementing directional and point light
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Implementing multiple lights in a scene
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Implementing two-side shading
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      14. 6. Working with Shaders
        1. Introduction
        2. Implementing the wobble and ripple effect
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Procedural texture shading with object coordinates
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        4. Creating the circular pattern and making them revolve
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        5. Generating the brick pattern
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        6. Generating the polka dot pattern
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Discarding fragments
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Procedural texture shading with texture coordinates
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      15. 7. Textures and Mapping Techniques
        1. Introduction
        2. Applying texture with UV mapping
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Filtering
            2. Wrapping
            3. MIP mapping
          5. See also
        3. Efficient rendering with the ETC2 compressed texture
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Applying multiple textures
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        5. Implementing Skybox with seamless cube mapping
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Implementing reflection and refraction with environment mapping
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Implementing render to texture with Frame Buffer Objects
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        8. Implementing terrain with displacement mapping
          1. How to do it...
          2. How it works...
          3. See also
        9. Implementing bump mapping
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      16. 8. Font Rendering
        1. Introduction
        2. Font rendering with the FreeType project
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Rendering different languages with Harfbuzz
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Rendering text on Head Up Display
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      17. 9. Postscreen Processing and Image Effects
        1. Introduction
        2. Detecting scene edges with the Sobel operator
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Making the scene blur with the Gaussian blur equation
          1. How to do it...
          2. How it works...
          3. See also
        4. Making a scene glow real time with the bloom effect
          1. How to do it...
          2. How it works...
          3. See also
        5. Painting the scene like a cartoon shading
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Generating an embossed scene
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        7. Implementing grayscale and CMYK conversions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        8. Implementing fisheye with barrel distortion
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        9. Implementing the binocular view with procedural texturing
          1. How to do it...
          2. How it works...
          3. See also
        10. Twirling the image
          1. How to do it...
          2. How it works...
          3. See also
        11. Sphere illusion with textured quadrilateral
          1. How to do it...
          2. How it works...
          3. See also
      18. 10. Scene Management with Scene Graphs
        1. Introduction
        2. Implementing the first scene using a scene graph
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Adding local and relative transformations
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. See also
        4. Adding parent-child support in the scene graph
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        5. Creating complex models with a transformation graph
          1. How to do it...
          2. How it works...
          3. See also
        6. Implementing picking with the ray trace technique
          1. How to do it...
          2. How it works...
          3. See also
        7. Implementing 2D textured button widgets
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        8. Navigating the scene with a camera system
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        9. Implementing the scene with multiple views
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
      19. 11. Anti-aliasing Techniques
        1. Introduction
        2. Understanding the sampling rate technique
          1. How to do it...
        3. Understanding the post processing technique
          1. How to do it...
        4. Implementing fast approximate anti-aliasing
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Implementing adaptive anti-aliasing
          1. How to do it...
          2. How it works...
          3. See also
        6. Implementing an anti-aliased circle geometry
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      20. 12. Real-time Shadows and Particle System
        1. Introduction
        2. Creating shadows with shadow mapping
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. The shadow map resolution
            2. Aliasing affects
            3. Shadow acne
          5. See also
        3. Softening the shadow edges using PCF
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Using variance shadow mapping
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Simulating the particle system
          1. Getting ready...
          2. How to do it...
          3. How it works...
          4. See also
        6. Transform feedback particle system with sync objects and fences
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      21. A. Supplementary Information on OpenGL ES 3.0
        1. The fixed function and programmable pipeline architecture
          1. Fixed pipeline architecture
          2. The programmable pipeline architecture
        2. Software requirements for OpenGL ES 3.0 – Android ADT
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Developing the Hello World Triangle application on Android Studio with OpenGL ES 3.0
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Software requirements for OpenGL ES 3.0 – iOS
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Opening a sample project on Android ADT and iOS
        6. Application of the Lambert's cosine law
        7. Calculating cosine between two vectors
        8. Swizzling
          1. Getting ready
          2. How to do it...
          3. There's more...
      22. Index