

So while GL_TRIANGLES draws filled triangles and GL_LINES draws line segments, GL_PONTS is a completely different beast – it draws a single point (which you can map a texture to). This command tells the GPU to draw every vertex as a square point, which reduces your 4-vertices-per-sprite problem to just 1! Thankfully, OpenGL ES 2.0 makes sprite rendering a lot easier with GL_POINTS. Particle systems routinely deal with hundreds of units - that means a LOT of vertices! Using this triangle-based implementation of textured quads requires at least 4 vertices per sprite. If you’ve developed graphics applications before, you may be familiar with sprites as textured quads which are essentially a set of two triangles which form a rectangular area for a 2D texture.Ī great example of a sprite is the little creature below, taken from the tutorial How To Create A Simple 2D iPhone Game with OpenGL ES 2.0 and GLKit: For example, a single block in Tetris is a sprite, as well as a coin in Super Mario.

In computer graphics, a sprite is simply a stand-alone 2D image within a scene. That should give you a basic understanding of particle systems, but there’s another concept to discuss as well - point sprites. Together, their properties form a particle system. Depending on weather conditions, the cloud may produce rain, hail, or snow, which would be the particles.Įach particle in the system has a different size, consistency, and starting position. At the top, you have a cloud which is the emitter in this system. Precipitation is a great example of a particle system. At the bottom you have the particles themselves, a large collection of small objects which share very similar characteristics, but are all unique independent entities.At the top you have the emitter which is the source, or generator, which controls the overall behaviour of the particles.You can think of a particle system as having two levels: New to particle systems? Don’t worry - we’ve got you covered. Without further ado, let’s spawn some particles! What’s a Particle System? If you are new to these, you should first read our Beginning OpenGL ES 2.0 with GLKit and How To Create A Simple 2D iPhone Game with OpenGL ES 2.0 and GLKit tutorial series. This tutorial series assumes you have some prior familiarity with OpenGL ES 2.0 and GLKit. Part 3: Finally, you’ll use your newly developed skills to integrate particle effects into a simple 2D game.That’s code word for “awesome and reusable”. Part 2: In the next part, you’ll learn to create a generic particle-emitter paired system.Part 1: You are here! You’ll start by learning all about particle systems and point sprites, and create a small app to help you learn as you go.In this three part OpenGL ES particle system tutorial series, you’ll learn how to make a cool and fun particle system from scratch, and integrate it into an iOS app!
