Particle Types Supported
|Top Previous Next|
DPSF supports 6 types of particle systems: Sprites, Quads, Textured Quads, and No Display. Before you start building your particle system, you will want to determine which type of particle system best fits your needs.
Sprite particle systems are drawn as a texture in 2D screen coordinates using a SpriteBatch object. Even though these have 2D screen positions, they may also be given a Z value between 0.0 (front) and 1.0 (back) to determine which sprites are drawn in front of other sprites (Z-buffer). Sprites only allow for 2D roll rotations, always face the camera, and must use a texture.
Unlike the rest of the particle systems, Sprite particle systems are not affected by the World, View, and Projection matrices, since they are in 2D screen coordinates. Also, Sprite particle systems have some extra settings that affect how the SpriteBatch draws them, including a Transformation matrix, and these may be modified in the SpriteBatchSettings object (see the DPSF API Documentation for more information on the SpriteBatchSettings class).
There is also a Sprite3DBillboardParticleSystem that may be used which inherits from the Sprite particle type. The particle types share all of the same properties as the regular Sprite particle type, except that they are drawn in 3D world coordinates as billboard textures using a SpriteBatch object and the AlphaTestEffect.
The DefaultSpriteParticleVertex should be used for Sprite particle systems, although the structure is empty and does not contain any properties since the vertex buffer is not used to draw Sprite particle systems; a SpriteBatch object is used.
Quad particle systems require four vertices per particle in the vertex buffer, and each vertex typically has at least a position in 3D world coordinates and a color. The vertices may be given additional properties as well, such as a normal direction if lighting is desired. Quad particles allow for rotations in all 3 dimensions, do not have to always face the camera, may be skewed into any quadrilateral such as a square, rectangle, or trapezoid, and do not use a texture. The relation of the quads four vertices' position to one another determines the orientation of the particle.
The DefaultQuadParticleVertex contains only a 3D position and a color.
Textured Quad particle systems have the same properties as Quads, except that they must use a texture so the vertices must contain texture coordinates. Also, the vertices do not have to contain a color property, but may use one with which to tint the color of the texture.
The DefaultTexturedQuadParticleVertex contains a 3D position, texture coordinates, and a color.
No Display particle systems are meant for situations where the particles will not be visualized (e.g. drawn to the screen), such as possible research applications or when using a DPSF particle system as an internal data structure. No Display particle systems require less memory as they do not require a vertex buffer since the particles will not be drawn.
The DefaultNoDisplayParticleVertex should be used for No Display particle systems, although the structure is empty and does not contain any properties since the particles will not be drawn and a vertex buffer is not required.