Learn OpenGL ES: For Mobile Game and Graphics Development

Book description

Want to create sophisticated games and graphics-intensive apps? Learn OpenGL ES gets you started immediately with OpenGL ES. After mastering the basics of OpenGL ES itself, you will quickly find yourself writing and building game apps, without having to learn about object oriented programming techniques.

This book demonstrates the use of a powerful open-source modeling tool, Blender. You will be guided, step by step, through the development of Tank Fence, a dynamic, interactive 3D game. Along the way you'll gain skills in building apps with Eclipse and the Android SDK or NDK, rendering graphics using hardware acceleration, and multithreading for performance and responsiveness. iOS developers will also find this book's information invaluable when writing their apps.

You'll learn everything you need to know about:

  • Creating simple, efficient game UIs

  • Designing the basic building blocks of an exciting, interactive 3D game

  • Pulling all the elements together with Blender, a powerful open-source tool for modeling, animation, rendering, compositing, video editing, and game creation

  • Taking the next big step using custom and inbuilt functions, texturing, shading, light sources, and more

  • Refining your mobile game app through collision detection, player-room-obstacle classes, and storage classes

  • Doing all this efficiently on mobile devices with limited resources and processing

  • What you'll learn

  • How to install and use OpenGL ES 2.0 on Android

  • GLSL ES Fundamentals

  • State Management

  • Modeling 3D Objects Using Blender

  • Using the Perl Mesh Parser

  • Vertex Buffer Objects

  • Using Color Masks

  • sampler2D and samplerCube Uniforms

  • Multi-Texturing

  • Lambert Illumination Model

  • Implementing the Lighting Equation

  • Design, write, and build Tank Fence, an interactive 3D game

  • Who this book is for

    Learn OpenGL ES is ideal for mobile game and interactive app developers who want to know more about the OpenGL ES engine and and use it to build more sophisticated, graphically-rich games and other apps. While the code is developed on Android, iOS developers will also find this book invaluable.

    Table of contents

    1. Title Page
    2. Dedication
    3. Contents at a Glance
    4. Contents
    5. About the Author
    6. About the Technical Reviewer
    7. Acknowledgments
    8. Preface
    9. Chapter 1: Benefits of the New API
      1. Modern Graphic-rendering API
      2. Devices Love It
      3. Easy App Development: Let’s Create an OpenGL Surface View
      4. ES 2.0 Is for the Ambitious
      5. Where Are the Developers?
      6. Summary
    10. Chapter 2: Implementation Prerequisites
      1. Selecting a Development Device: Why Upgrade to Gingerbread?
      2. Choosing Inputs That Your Game Needs
      3. Tank Fence
      4. Creating Menus for the Game
      5. Setting Views Using setContentView and addContentView
      6. Sleek Design of XML Views
      7. Working with Buttons and the Counter Class
      8. Using Touch for Rotation
      9. Rotation Using Android Sensors
      10. Summary
    11. Chapter 3: ES 2.0 Fundamentals
      1. EGL on Android
      2. Renderer Thread
      3. Implemented Methods
      4. Framebuffer
      5. GLSL
      6. GL POINT BASIC Application
      7. Drawing Line and Triangle Primitives
      8. Normalized Device Coordinate System
      9. 3D-Transformation
      10. State Management
      11. Summary
    12. Chapter 4: 3D Modeling
      1. Drawing Shapes Using glDrawElements
      2. Blender for Modeling
      3. Parsing Objects for OpenGL ES
      4. Using the Mesh Data
      5. Basic Components in the Blender Interface: Screenshots
      6. Summary
    13. Chapter 5: Texturing and Shading
      1. Vertex Buffer Objects
      2. Types of Buffer Objects
      3. Using Buffer Objects
      4. Using Color Masks
      5. Textures
      6. Lighting Effects Using Shader Programs
      7. Summary
    14. Chapter 6: Taking the Development Ahead
      1. Specifying the Render Mode
      2. Adding the Fire Button
      3. Combining Translation with Rotation
      4. Including Missiles for the Tank
      5. The Enemy Class
      6. Detecting Collisions to Annihilate the Enemy
      7. Summary
    15. Index

    Product information

    • Title: Learn OpenGL ES: For Mobile Game and Graphics Development
    • Author(s):
    • Release date: August 2013
    • Publisher(s): Apress
    • ISBN: 9781430250531