• ParticleEmitterComponent (Components\ParticleEmitterComponents\ParticleEmitterComponent.cs) 
    • The particle emitter component is a component that is in charge of creating particles that the graphics system can query for.
    • This particle system is based off of the 3D Particle Sample from XNA’s Education Sample.
    • QS Engine’s particle system is a fire and forget system. The CPU creates particles with some initial parameters, and the GPU takes it from there. This allows an entire particle emitter to emit as many particles as you’d like with a maximum of only two draw calls.
    • To load a particle emitter, there are a few simple steps:
      • Create all particle settings through the component definition XML file.
        • MaterialPath: This is the path to the material file that describes the texture and shader used to render the particles from this emitter.
        • MaxParticles: Maximum number of particles of this type that an emitter can have in the world at any one time.
        • Duration: Length of a time that the particle will exist.
        • DurationRandomness: A positive or negative value that will add randomness to the duration of the particle.
        • EmitterVelocitySensitivity: The higher this value is the more this particle will respond to any velocity given to it. Anything between -1 and 1 will make the sensitivity less.
        • MinHorizontalVelocity: Minimum horizontal velocity this particle will travel at.
        • MaxHorizontalVelocity: Maximum horizontal velocity this particle will travel at.
        • MinVerticalVelocity: Minimum vertical velocity this particle will travel at.
        • MaxVerticalVelocity: Maximum vertical velocity this particle will travel at.
        • Gravity: Gravity to be exerted on the particle. Using a negative gravity on the particle will cause it to move upward.
        • EndVelocity: Speed the particle will end up at by the time is dies.
        • Min/MaxColor: Color of the particle will be between the min and max colors. This color is in addition to whichever color the particles texture is as well.
        • Min/MaxColorVect: Not used in XML, don't bother changing these.
        • Min/MaxRotateSpeed: Rotation speed in either direction. Rotation is slightly more expensive for rendering, so only use if it is truly noticable and needed.
        • RotateSpeed: Not used in XML.
        • Min/MaxStartSize: Starting size of the particle will randomly be between the min/max start size.
        • StartSize: Not used in XML.
        • Min/MaxEndSize: Ending size of the particle will randomly be between the min/max end size.
        • SourceBlend: SourceBlend render state that this particle type uses.
        • DestinationBlend: DestinationBlend render state that this particle type uses.
      • Now that you’ve defined some particle settings, you need to give your particle emitter a material.  For an example of this, look in 'Content\Material\Particles\'.
        • Unless you’re making changes to the particle system in the engine itself, the only part of the material you’re going to care about for this particle is the TEXTURE. This is the texture that your particle will use. Other than that, all other settings in the material can remain the same for all particles.

Last edited Jan 5, 2012 at 5:43 AM by LordIkon, version 1

Comments

No comments yet.