|
Particle Types Supported |
Top Previous Next |
|
DPSF supports 6 types of particle systems: Pixels, Sprites, Point 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.
Pixel particle systems require only one vertex per particle in the vertex buffer, and each vertex typically only has a position in 3D world coordinates and a color. These particles are always 1 pixel in size, regardless of their distance from the camera, cannot be rotated, and do not use a texture.
The DefaultPixelParticleVertex contains only a 3D position and a color.
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).
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.
Point Sprite particle systems require only one vertex per particle in the vertex buffer, and each vertex typically has at least a position in 3D world coordinates and a size. The vertices optionally may also be given a color with which to tint the color of the particle's texture, and a 2D roll rotation value as well. Point Sprites always face the camera and must always use a texture. Also, because Point Sprites only have a size value, not width and height values, they are always a perfect square (i.e. cannot be stretched or skewed).
The DefaultPointSpriteParticleVertex contains a 3D position, size, color, and 2D roll rotation value.
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.
|