O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Drawing Each Point as a Sprite

The technique we just learned works, but sometimes a texture works better. Using the same gl_PointCoord and a texture, we can actually draw each point as a point sprite. We’ll change our particle shader to use the texture shown in Figure 55, Texture for Particles for each particle.

images/Particles/ParticleTextureHiResForBook.png
Figure 55. Texture for Particles

This texture (particle_texture.png) and all of the textures that we’ll use in future chapters can be downloaded from this book’s home page. I recommend storing this texture in your project’s /res/drawable-nodpi/ folder.[51]

We’ll use the knowledge that we’ve learned in Chapter 7, Adding Detail with Textures ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required