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.

No comments: