The Ultimate Particle System
So I need to update and maintain a particle system for a relatively new company. This system must be fully featured enough to compete with the best out there.
The Competition
So who are the best competitors?
- Squaresoft's latest title (?)
- Relic's Essence Engine
- Killzone 2
- Super Stardust HD
The Editor
- Automatic updating of textures as they are changed (similar to Unity3D)
- Automatic reloading of particle attributes
- Dynamic placement of new particle systems with no rebuilding of the game
The Feature Set
- Megaparticle support
- Soft particles
- Extremely fast rendering
- Extremely fast simulation
- Optional physics interaction
- Reflections and refractions
- Normal mapping
- Per particle sorting
- Attachment to objects
- (possibly) Spawn from the surface of a mesh
- Low memory requirements per particle emitter
- Particles (or their emitters) that light the surrounding environment
What it should simulate
- Water
- Fire
- Lightning
- Smoke
- Fireworks
Making it Fast
This can be divided into two parts: a) simulation b) rendering
Making Simulation Fast
Because we are targeting consoles, we should take advantage of threading on either a multicore Xbox or a multi-SPU Playstation. There are alternatives to using a threaded simulation thread(s), mainly using the GPU to evalute the particles. This can be done by encoding the particle information into a texture and using RTT to evaluate it, or it can be done by encoding the information in a stream. The RTT evaluation is using up valuable GPU time so it should be inheritantly slower than the threaded approach unless we are using a massively large number of particles which should minimize the fixed setup cost.
Because we want to sort the particles front to back, we ideally need at least part of the particle system running on a thread.
Simulating the particles on the vertex shader is another option. This method is potentially extremely fast but somewhat unforgiving of large amounts of branching.
Making Rendering Fast
- Minimize state changes to both the vertex and pixel shaders
- Minimize number of interpolators used
- Texture pack and page everything
- Ideally rendering to a smaller buffer
- Should we consider point sprites?
If you’ve seen the Killzone 2 trailer, then you are aware of the huge number of particle effects that the game uses. The particle effects are actually run on the SPU and it was common to have 300 systems with 5000 particles per frame and 200 particle collisions per frame. The particles were created in low res and optimized for high res shots. The trick was to define several particle driven shader variables, which were used like vertex colors. These new shader values that gave better art control over the particles. Jan then showed how these new shader values were used to create some unique effects like foam in the waves on a shoreline and a corona effect.
Killzone 2 Particle System - Notes from GDC
Soft Particles
nvidia's article on soft particles (using DirectX 10)
This article describes three ways to do soft particles:
- fast linear falloff with poor quality (also used in GPU Gems 3 - High-Speed Off-screen particles)
- slow piecewise continuous curve with excellent quality
- middle quality, middle speed curve
I also want to use the spherical billboard approach described in ShaderX 5.1. This system is completely different from soft particles and is mostly useful for volumetric effects.
Question: do we want to use shaderx 5.1 - Spherical Billboards. This
Benefits of Downsizing - from the Budapest University of Technology and Economics
Particles and Shadows
ATI found a way to make volumetric particles cast shadows. Awefully expensive.
