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.
Buy Now
This title is currently available in Beta. Buy the eBook now, and you'll be able to download successive releases of the eBook as the authors add material and correct mistakes. You'll get the final eBook when the book is finished.
If you buy the combo pack (Beta eBook + finished Paper Book) now, you'll get the Beta eBook immediately. You'll get the finished paper book when it's released (we're currently estimating 2013-07-30, but these dates can change).
About this Book
- 325 pages (est)
- Published:
- Release: B7.0 (2013-04-04)
- ISBN: 978-1-93778-534-5
This book will teach you everything you need to know to create compelling graphics on Android. You’ll learn the basics of OpenGL by building a simple game of air hockey, and along the way, you’ll see how to initialize OpenGL and program the graphics pipeline using shaders. Each lesson builds upon the one before it, as you add colors, shading, 3D projections, touch interaction, and more.
Then, you’ll find out how to turn your idea into a live wallpaper that can run on the home screen. You’ll learn about more advanced effects involving particles, lighting models, and the depth buffer. You’ll understand what to look for when debugging your program, and what to watch out for when deploying to the market.
OpenGL can be somewhat of a dark art to the uninitiated. As you read this book, you’ll learn each new concept from first principles. You won’t just learn about a feature; you’ll also understand how it works, and why it works the way it does. Everything you learn is forward-compatible with the just-released OpenGL ES 3, and you can even apply these techniques to other platforms, such as iOS or HTML5 WebGL.
What You Need
Preferably an Android phone or tablet that supports OpenGL ES 2.
Contents and Extracts
This book is currently in beta, so the contents and extracts will change as the book is developed.
- Welcome to OpenGL ES for Android!
- Getting Started
- Installing the Tools
- Creating Our First Program
- Initializing OpenGL
- Creating a Renderer Class
- Using Static Imports
- A Review
- A Simple Game of Air Hockey
- Defining Vertices and Shaders
- Why Air Hockey?
- Don’t Start From Scratch — Reusing Our Project
- Defining the Structure of Our Air Hockey Table
- Making the Data Accessible to OpenGL
- Introducing the OpenGL Pipeline
- The OpenGL Color Model
- A Review
- Compiling Shaders and Drawing to the Screen excerpt
- Loading Shaders
- Compiling Shaders
- Linking Shaders Together into an OpenGL Program
- Making the Final Connections
- Drawing to the Screen
- A Review
- Exercises
- Adding Color and Shade
- Smooth Shading
- Introducting Triangle Fans
- Adding a New Color Attribute
- Rendering with the new color attribute
- A Review
- Exercises
- Adjusting to the Screen’s Aspect Ratio
- We Have an Aspect Ratio Problem
- Working With a Virtual Coordinate Space
- Linear Algebra 101
- Defining an Orthographic Projection
- Adding an Orthographic Projection
- A Review
- Exercises
- Entering the Third Dimension excerpt
- The Art of 3D
- How Opengl Transforms a Coordinate from the Shader to the Screen
- Adding the W Component to Create Perspective
- Moving from an Orthographic to an Perspective Projection
- Defining a Perspective Projection
- Creating a Projection Matrix In Our Code
- Switching to a Projection Matrix
- Adding Rotation
- A Review
- Exercises
- Adding Detail with Textures
- Understanding Textures
- Loading Textures into OpenGL
- Creating a New Set of Shaders
- Creating a New Class Structure for Our Vertex Data
- Adding Classes for Our Shader Programs
- Drawing Our Texture
- A Review
- Exercises
- Building Simple Objects
- Combining Triangle Strips and Triangle Fans
- Adding a Geometry Class
- Adding an Object Builder
- Updating Our Objects
- Updating Shaders
- Integrating Our Changes
- A Review
- Exercises
- Adding Touch Feedback
- Adding Touch Support to Our Activity
- Adding Intersection Tests
- Moving Around an Object by Dragging
- Adding Collision Detection
- A Review and Wrapup
- Exercises
- Defining Vertices and Shaders
- Bringing Things to Life
- Spicing Things Up With Particles
- Creating a Set of Shaders for a Simple Particle System
- Adding the Particle System
- Drawing the Particle System
- Spreading out the Particles
- Adding Gravity
- Mixing the Particles With Additive Blending
- Customizing the Appearance of Our Points
- Drawing Each Point as a Sprite
- A Review
- Exercises
- Adding a Skybox
- Creating a Skybox
- Loading a Cube Map into OpenGL
- Creating a Cube
- Adding a Skybox Shader Program
- Adding the Skybox to Our Scene
- Panning the Camera Around the Scene
- A Review
- Exercises
- Adding Terrain excerpt
- Creating a Heightmap
- Creating Vertex and Index Buffer Objects
- Loading in the Heightmap
- Drawing the Heightmap
- Occluding Hidden Objects
- A Review
- Exercises
- Light Up the World
- Live Wallpapers
- Taking the Next Step
- Spicing Things Up With Particles


