You are previewing OpenGL ES 2 for Android.
O'Reilly logo
OpenGL ES 2 for Android

Book Description

Android is booming like never before, with millions of devices shipping every day. It's never been a better time to learn how to create your own 3D games and live wallpaper for Android. You'll find out all about shaders and the OpenGL pipeline, and discover the power of OpenGL ES 2.0, which is much more feature-rich than its predecessor. If you can program in Java and you have a creative vision that you'd like to share with the world, then this is the book for you.

Table of Contents

  1. OpenGL ES 2 for Android
    1. Copyright
    2. For the Best Reading Experience...
    3. Table of Contents
    4. Early praise for OpenGL ES 2.0 for Android
    5. Foreword
    6. Acknowledgments
    7. Welcome to OpenGL ES for Android!
      1. What Will We Cover?
      2. Who Should Read This book?
      3. How to Read This Book
      4. Conventions
      5. Online Resources
      6. Let’s Get Started!
    8. Chapter 1: Getting Started
      1. Installing the Tools
      2. Creating Our First Program
      3. Initializing OpenGL
      4. Creating a Renderer Class
      5. Using Static Imports
      6. A Review
    9. Part 1: A Simple Game of Air Hockey
      1. Chapter 2: Defining Vertices and Shaders
        1. Why Air Hockey?
        2. Don’t Start from Scratch
        3. Defining the Structure of Our Air Hockey Table
        4. Making the Data Accessible to OpenGL
        5. Introducing the OpenGL Pipeline
        6. The OpenGL Color Model
        7. A Review
      2. Chapter 3: Compiling Shaders and Drawing to the Screen
        1. Loading Shaders
        2. Compiling Shaders
        3. Linking Shaders Together into an OpenGL Program
        4. Making the Final Connections
        5. Drawing to the Screen
        6. A Review
        7. Exercises
      3. Chapter 4: Adding Color and Shade
        1. Smooth Shading
        2. Introducing Triangle Fans
        3. Adding a New Color Attribute
        4. Rendering with the New Color Attribute
        5. A Review
        6. Exercises
      4. Chapter 5: Adjusting to the Screen’s Aspect Ratio
        1. We Have an Aspect Ratio Problem
        2. Working with a Virtual Coordinate Space
        3. Linear Algebra 101
        4. Defining an Orthographic Projection
        5. Adding an Orthographic Projection
        6. A Review
        7. Exercises
      5. Chapter 6: Entering the Third Dimension
        1. The Art of 3D
        2. Transforming a Coordinate from the Shader to the Screen
        3. Adding the W Component to Create Perspective
        4. Moving to a Perspective Projection
        5. Defining a Perspective Projection
        6. Creating a Projection Matrix in Our Code
        7. Switching to a Projection Matrix
        8. Adding Rotation
        9. A Review
        10. Exercises
      6. Chapter 7: Adding Detail with Textures
        1. Understanding Textures
        2. Loading Textures into OpenGL
        3. Creating a New Set of Shaders
        4. Creating a New Class Structure for Our Vertex Data
        5. Adding Classes for Our Shader Programs
        6. Drawing Our Texture
        7. A Review
        8. Exercises
      7. Chapter 8: Building Simple Objects
        1. Combining Triangle Strips and Triangle Fans
        2. Adding a Geometry Class
        3. Adding an Object Builder
        4. Updating Our Objects
        5. Updating Shaders
        6. Integrating Our Changes
        7. A Review
        8. Exercises
      8. Chapter 9: Adding Touch Feedback: Interacting with Our Air Hockey Game
        1. Adding Touch Support to Our Activity
        2. Adding Intersection Tests
        3. Moving Around an Object by Dragging
        4. Adding Collision Detection
        5. A Review and Wrap-Up
        6. Exercises
    10. Part 2: Building a 3D World
      1. Chapter 10: Spicing Things Up with Particles
        1. Creating a Set of Shaders for a Simple Particle System
        2. Adding the Particle System
        3. Drawing the Particle System
        4. Spreading Out the Particles
        5. Adding Gravity
        6. Mixing the Particles with Additive Blending
        7. Customizing the Appearance of Our Points
        8. Drawing Each Point as a Sprite
        9. A Review
        10. Exercises
      2. Chapter 11: Adding a Skybox
        1. Creating a Skybox
        2. Loading a Cube Map into OpenGL
        3. Creating a Cube
        4. Adding a Skybox Shader Program
        5. Adding the Skybox to Our Scene
        6. Panning the Camera Around the Scene
        7. A Review
        8. Exercises
      3. Chapter 12: Adding Terrain
        1. Creating a Height Map
        2. Creating Vertex and Index Buffer Objects
        3. Loading in the Height Map
        4. Drawing the Height Map
        5. Occluding Hidden Objects
        6. A Review
        7. Exercises
      4. Chapter 13: Lighting Up the World
        1. Simulating the Effects of Light
        2. Implementing a Directional Light with Lambertian Reflectance
        3. Adding Point Lights
        4. A Review
        5. Exercises
      5. Chapter 14: Creating a Live Wallpaper
        1. Implementing the Live Wallpaper Service
        2. Playing Nicely with the Rest of the System
        3. A Review
        4. Exercises
      6. Chapter 15: Taking the Next Step
        1. Looking Toward Other Platforms
        2. Learning About More Advanced Techniques
        3. Sharing Your Artistic Vision with the World
    11. Appendix 1: The Matrix Math Behind the Projections
      1. The Math Behind Orthographic Projections
      2. The Math Behind Perspective Projections
    12. Appendix 2: Debugging
      1. Debugging with glGetError
      2. Using Tracer for OpenGL ES
      3. Pitfalls to Watch Out For
    13. Bibliography
      1. You May Be Interested In…