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.
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 ...
Get OpenGL ES 2 for Android now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.