For our intermediate computer graphics class we have been assigned a various number of challenging homework questions. These questions range from Photoshop manipulations of our game, implementing different types of shaders, and many other game related tasks. Once question however greatly interests me. For it, we have to develop different particle systems. The only trick is that they have to look good! In this two part post, I will be discussing what are particles, what you need to build them, why they are important, and some coding applications.
What is a particle? A particle system?
Particles refer to a technique of simulating effects in computer graphics by the use of small sprites or other objects that would otherwise be hard to create. A particle can be represented by using:
- Points
- Sprites
- Different shapes (spheres for example)
A particle system refers to a collection of any number of particles that share attributes. In video games, they are used to produce all sorts of amazing effects and some games are completely reliant on particles and particle systems such as Geometry Wars.
An example of particles working with various emitters |
Why are they so important?
Particles in video games can be used to achieve many different effects, but they can also be used to enhance or change a gamers experience. For example, a scene littered with fire and random explosions may suggest a war like area, or a gentle snow fall in a forest may give the player a feeling of serenity. They can set the mood, define an experience, make something epic.
With particles you can achieve just about anything. Many games will use them to their advantage to set a mood, such as the example video shows. It demonstrates the increasingly deadly threat of the current areas destruction with randomly explosions and fire.
Coding application of particles
Particles and particle systems share different attributes in the 3D world. When developing a particle system, it is important to understand how each particle works and how they will be effect by particle physics. Some attributes of a particle would be:
- Position
- Velocity
- Acceleration
- Life Span
- Size
- Color
- Position
- Number of particles
- Emission rate
- Current state (is that tree burning or not?)
- Particle list (What type of particles are we using)
Games like Empire: Total War would have taken hundreds of particle emitters and thousands of particles into consideration. |
Effective use of particles is trying to use as little particles as possible to achieve your desired effect. Many games will implement sprites to achieve a fire or smoke effect that uses a fade and color change to give it the proper effect that is needed. You can often see this effect with trees in games where a group of leaves are simply 2D sprites that are effected by the wind in the game. This saves on computation and can be used to make a realistic object in your game.
Sprites are an excellent way of getting a lot for very little. Smoke blooms are often generated by having a very small sprite that grows larger and fades over time to give the proper effect. Sprites were suggested to me by my TA for intermediate computer graphics, and after realizing this, it didn't take long to know just many games use sprites for their particles.
Conclusion
Particles are an excellent way of achieving literally hundreds if not thousands of different goals in video games. From smoke and fire, to mood, or more practical uses like a gun shot, game developers can use them to achieve many different things.
When developing a particle system, you have to take all of these attributes in consideration when creating it. Next week, I will finish off this two part talk about particles about discussing how FBO's and Geometry shaders can be used to improve a basic CPU particle system.
Thanks for reading, I hope you enjoyed it and learned something!