Learn OpenGL ES

Learn how to develop mobile graphics using OpenGL ES 2

Category: Android Tutorials

Finishing Up Our Native Air Hockey Project With Touch Events and Basic Collision Detection

In this post in the air hockey series, we’re going to wrap up our air hockey project and add touch event handling and basic collision detection with support for Android, iOS, and emscripten. Prerequisites This lesson continues the air hockey project series, building upon the code from GitHub for ‘article-3-matrices-and-objects’. Here are the previous posts in this series: … Continue reading Finishing Up Our Native Air Hockey Project With Touch Events and Basic Collision Detection»

Adding a 3d Perspective and Object Rendering to Our Air Hockey Project in Native C Code

For this post in the air hockey series, we’ll learn how to render our scene from a 3D perspective, as well as how to add a puck and two mallets to the scene. We’ll also see how easy it is to bring these changes to Android, iOS, and emscripten. Prerequisites This lesson continues the air … Continue reading Adding a 3d Perspective and Object Rendering to Our Air Hockey Project in Native C Code»

Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2, Using (Almost) the Same Code on iOS, Android, and Emscripten

In the last post in this series, we setup a system to render OpenGL to Android, iOS and the web via WebGL and emscripten. In this post, we’ll expand on that work and add support for PNG loading, shaders, and VBOs. TL;DR We can put most of our common code into a core folder, and … Continue reading Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2, Using (Almost) the Same Code on iOS, Android, and Emscripten»

Calling OpenGL from C on Android, Using the NDK

For this first post in the Developing a Simple Game of Air Hockey Using C++ and OpenGL ES 2 for Android, iOS, and the Web series, we’ll create a simple Android program that initializes OpenGL, then renders simple frames from native code. Prerequisites The Android SDK & NDK installed, along with a suitable IDE. An … Continue reading Calling OpenGL from C on Android, Using the NDK»

Android Lesson Eight: An Introduction to Index Buffer Objects (IBOs)

In our last lesson, we learned how to use vertex buffer objects on Android. We learned about the difference between client-side memory and GPU-dedicated memory, and the difference between storing texture, position and normal data in separate buffers, or altogether in one buffer. We also learned how to work around Froyo’s broken OpenGL ES 2.0 … Continue reading Android Lesson Eight: An Introduction to Index Buffer Objects (IBOs)»

Android Lesson Seven: An Introduction to Vertex Buffer Objects (VBOs)

In this lesson, we’ll introduce vertex buffer objects (VBOs), how to define them, and how to use them. Here is what we are going to cover: How to define and render from vertex buffer objects. The difference between using a single buffer with all the data packed in, or multiple buffers. Problems and pitfalls, and what … Continue reading Android Lesson Seven: An Introduction to Vertex Buffer Objects (VBOs)»

Android Lesson Six: An Introduction to Texture Filtering

In this lesson, we will introduce the different types of basic texture filtering modes and how to use them, including nearest-neighbour filtering, bilinear filtering, and trilinear filtering using mipmaps. You’ll learn how to make your textures appear more smooth, as well as the drawbacks that come from smoothing. There are also different ways of rotating … Continue reading Android Lesson Six: An Introduction to Texture Filtering»

Android Lesson Five: An Introduction to Blending

In this lesson we’ll take a look at the basics of blending in OpenGL. We’ll look at how to turn blending on and off, how to set different blending modes, and how different blending modes mimic real-life effects. In a later lesson, we’ll also look at how to use the alpha channel, how to use … Continue reading Android Lesson Five: An Introduction to Blending»

Android Lesson Four: Introducing Basic Texturing

This is the fourth tutorial in our Android series. In this lesson, we’re going to add to what we learned in lesson three and learn how to add texturing.We’ll look at how to read an image from the application resources, load this image into OpenGL ES, and display it on the screen. Follow along with me and … Continue reading Android Lesson Four: Introducing Basic Texturing»

Android Lesson Three: Moving to Per-Fragment Lighting

Welcome to the the third tutorial for Android! In this lesson, we’re going to take everything we learned in lesson two and learn how to apply the same lighting technique on a per-pixel basis. We will be able to see the difference, even when using standard diffuse lighting with simple cubes. Assumptions and prerequisites Each … Continue reading Android Lesson Three: Moving to Per-Fragment Lighting»