This project is to create a particle system editor so that particle systems can be designed in a simple editor and have their settings exported to a file for use later. All useful settings for a particle system will be able to be edited via a GUI. There will also be a display so the user can see the results of the various settings.
This project will initially be comprised of 2 programs with a third added later. The first program is the GUI for editing the various settings. The second is a XNA rendering program for displaying the current settings. The third is a D3D11 rendering program. This project could be done with 1 program with a winforms or WPF GUI with a XNA child window. But since particle systems are a nice start to working in D3D11, editing and rendering will be different programs so that the editor can be kept the same for the XNA and D3D11 rendering programs.
The editing GUI will organize related settings together in categories. The following subsections list the different categories and their configuration parameters.
This allows for editing the camera used by the rending program. The camera is an orbit style one that moves about its look at position. These configuration parameters are not actually part of the particle system.
World coordinates of the position that the camera should be looking at
How far away, in units, the camera should be from the look at position
How much yaw/orbit to use in computing the camera's position
How much to pitch the camera above/below the orbit plane
Determines the shape of the emitter used to generate particles
Value | Description |
---|---|
Point | All particles have their initial position set to the emitter's position |
Line | All particles are created along a unit length line that is aligned along the x-axis and centered at the origin |
Square | Particles are created in a 1x1 region aligned with the emitter's local xz plane centered at the origin |
Square Perimeter | Particles are created along the perimeter of a 1x1 region aligned with the emitter's local xz plane centered at the origin |
Circle | Particles are created in a unit circle aligned with the emitter's local xz plane centered at the origin |
Ring | Particles are created along the circumference of a unit circle aligned with the emitter's local xz plane centered at the origin |
Sphere | Particles are created on the surface of a unit sphere centered at the origin |
Hemisphere | Particles are created on the z ≥ 0 half of the surface of a unit sphere centered at the origin |
World coordinates for the position of the emitter in xyz
Yaw, pitch, and roll rotation of the emitter
Allows for scaling the emitter in xyz after position and direction are taken into account
How long, in seconds, the emitter should spawn particles for
How many particles per second the emitter should generate
Value | Description | Addition Configuration Data |
---|---|---|
Directional | Particles move a particular direction | Unit vector for xyz in the emitter's local space that specifies the direction particles should move in |
Spherical | Particles can move in any direction | None |
Partial Sphere | Particles move a direction within a partial sphere aligned with the +z axis in the emitter's local space | All angles are in the range -180 to 180, with minimium angles being less than or equal to their corresponding max.
|
Determines the shape of the individual particles. Options are:
How long in ms individual particles should live for
Size of the particles in units
The minimium and maximum speed, in units/second, that particles can move at. The actual speed for a particle is randomly selected from within that range
Acceleration in the emitter's local space, in units/second^2, that should be applied to each particle over time. Each of the xyz components can be specified individually
Determines how particles are to have their color determined
Value | Description | Addition Configuration Data |
---|---|---|
Texture | An image is used to color the particles. Each particle has the full texture mapped to it. Pre-multiplied alpha blending is supported, which allows for greater variety of particle shapes. | Path to the image to use |
Color Set | Particle color is randomly chosen from a specified set of colors | Colors to include in the set, as well as the associated probability for each color |
Color Sequence | Particle color changes over time in a set sequence. The displayed color is a proportional fade of two colors in the sequence based on time. | Colors in the sequence, as well as percentage of the particle's life for when the color should occur |
Since the editor and rendering processes are seperate programs, they need a method to communicate. A TCP network connection between the processes will be used, with the rendering program operating as the server. Since it is assumed that the editor and rendering programs will be running on the same system, the editor will use synchronous network function calls. The rendering programs will only wait for a message if the socket indicates that a message is available to be read.
To minimize the amount of updating in the rendering program when the user changes a value, only what changed and its new value will be sent. The messages that communicate these changes are comprised of 3 fields, which are listed below. All multibyte fields are stored in network byte order.
The format for saved files will be an XML format, for which the xsd specification can be found here. The camera data is included in the file despite not being part of the particle system so that the previous view of a particle system can be restored on load in the editor.