Creating a New Particle Vertex Structure

Top  Previous  Next

The DPSF particle systems use a vertex structure to hold their particles' drawable properties in the vertex buffer in order to render the particles.  This vertex structure must implement the IDPSFParticleVertex interface.  The particle vertex structure should contain all of the information that you want sent to the effect file (i.e. shaders) to be rendered by the GPU (Graphics Processing Unit).


Step 0 - If you have not already created the particle class, do that first.


Step 1 - Locate the particle vertex struct that implements the IDPSFParticleVertex interface.  You should have already renamed / refactored this structs name when importing the template into your project, but if you did not then do it now.


Step 2 - Define any properties that the vertex buffer should hold to pass to the effect file (i.e. shaders), making sure they are public so they can be modified later.  The ones which can be used with the DPSF Default Effect are given by default in the template files, but these may be changed if you plan on specifying and using your own effect file.


Step 3 - Define the corresponding properties in the msVertexElements array, being sure to use the correct parameters when specifying new VertexElements.


Step 4 - Modify the miSizeInBytes variable to correspond to the size of one of the elements in the msVertexElements array.


The particle vertex setup should now be complete.  Continue on to creating a new particle system class.