Tuesday, July 31, 2007

Implementation phase I

Overview

In order for artists to smoke animations and effects easily, I am proposing the idea of using bezier curves to guide the dust/smoke particles in our current dust framework. The main idea is that smoke particles are emitted from the start of each spline and the particles follows the path of the spline throughout their entire lifespan. At the end of each spline, the particles will die off and gets destroyed.

The splines will have control points which allows artists to manipulate the bezier curves to the shape they desired. These control points are similar the controls in 2D drawing softwares such as the Macromedia Freehand but extending it to a 3D space. Thus, the implementation of these controls can be challenging.


Our Existing Dust Framework

In our current dust implementation, each smoke group consists of spherical dust particles which animate independently of each other. Currently, each smoke group consists of the following parameters:

1. starting position (emission point)
2. ending position (for spray effect)
3. max number of particles
4. max lifespan of each particle
5. other parameters (ie density, speed, displacement, etc)

Each particle consists of the following parameters:
1. lifespan
2. size
3. vector direction
4. alpha level

Right now, we have to individually adjust these parameters to achieve the required smoke effects.


Particle Motion

The existing Bezier function will compute points for which the curve is drawn on based on the control points. These computed points will serve as basis points for each particle to follow. Afterwhich, a randomised point d, based on a basis point e (for which a particle is to take position to), will be generated during the movement of the particle and the particle is directed to this random point d instead. Each randomise point is within a certain radius from their basis point. Thus this will create the random movement of the particles and prevent them from strictly following a single path. At the same time, the smoke particles will follow the generalised path of the spline.


Smoke Animation and Effects

Each particle in the smoke group will have its own texture space animation as in the current implementation. Each of them will follow the generalised path as indicated by the Bezier points. The lifespan of the particles is directly proportional to the length of the spline. This is to prevent the particles from being destroyed before reaching the end of the spline. Multiple splines can also be drawn to create a single effect. The diagrams below illustrates how this model can be used to model each effect. However, some of these effects may require a more complicated piecewise Bezier Curve implementation. For now I'll concentrate on implementing the framework using the basic Bezier function.


Burning smoke


Explosion


Cigar smoke


Tornado


Smoke and Environment Interaction

Smoke collision with other objects in the surrounding can be detected using the spline. We can check if the Bezier curve points falls within any object mesh and stop the smoke particles from animating towards that point. It may be more efficient to check the points than checking every individual particles for collision.

External forces such as the wind can be modelled using global vector forces. However this doesn't take into consideration of the density of the smoke. A denser smoke will move slower than lighter smoke. Thus, as smoke particles reaches it death, it becomes lighter and should tend to move faster with the wind.


Further Improvements

As stated above, piecewise Bezier curves can be used in the implementation instead to create a more powerful control and system. It will aid artists in creating more different kinds of smoke animations ans shapes such as the tornado effect.

Suitable geometric shape changing would be neccessary for certain kinds of effects such as thin smoke strain. The geometry should change its shape in such a way that conforms to the curve path. Thus, such same change can be looked into in the later stage of the implementation.

Monday, July 30, 2007

Milestones

The following are the tasks and deadlines:

  1. Create and animate primitives in Ogre (1 week - 07/08)
  2. Create arbitrary polygons in Ogre (1 week - 14/08)
  3. Create animation libraries for various effects (tornado, cigar smoke, etc.) and expose high level parameters for each effect (2-3 weeks - 31/08)
  4. Explore XNA and the shading system for XNA (2 weeks - 15/09)
  5. Port code and shaders (should be very minimal recoding of shaders hopefully) to XNA for XBOX 360 (2 weeks - 29/09)

Bezier Guides

I've come up of a idea of using bezier curves to guide our smoke spheres (particles). The beizier control points serves as handles for the artist to control how the smoke animates. Thus, the smoke particles movement will follow the bezier curves forming a tube-like effect. This can be combined with the control rings for the emitting point and ending point that we have discussed earlier. We can also add in multiple curves between the control rings to create multiple streams of smoke.

Questions to be answered:
  1. Are the metaballs being generated only at the base?
  2. How do the metaballs conform to the shape of the spline?
  3. How is the spline animated procedurally? How is it specified by a designer/animator in suitable detail, yet reactive to dynamic changes in the world, like moving objects, wind, impact events, etc.
  4. Do the metaballs change shape? Or do we continue to have round spheres (which can be a give-away for thin but bright smoke strands)? We can start without any shape changes to begin with, but we must explore a seamless shape deformation of individual primitives.
  5. How do you address the texture space animation issue, if one texture should represent an entire particle system (vs. one metaball, as in our current implementation)?
  6. How do you cater for efficient collision against rigid and moving objects?
  7. List the concrete effects and situations you will test this model.
  8. How will light sources be placed or configured to maximize the effect from a give view point?
  9. A thorough description of how you will modify each shader parameter to contribute to a given stage in an effect.