Thursday, August 23, 2007

Framework Updates

In the old framework, the dust-manager class cannot handle multiple effects and thus only one type of effect can only be shown on the screen. For now, I've change the static variables in CDustShader class to enable multiple effects to be handled by the dust manager. Also, I've created high level input parameters for the dust manager in order to allow easy specification of effects. The new input parameters includes shape (sphere, torus, cylinder, and a curvy shape primative) , element(fire, dust, smoke and light smoke) and motion (helix, rising straight smoke, dispersed, and no motion)

Currently, the program allows multiple effects such as fire, tornado, thin smoke etc to be displayed at the same time. Some screen shots of the effects have been taken.


Torus primative created


Small flame using Sphere primative


Burning


Thick smoke


Thin black smoke using curvy shape primative

Thin white smoke

Tornado using curvy shape primative

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.

Monday, June 25, 2007

Updates

Most of the realistic amorphous fluid models uses fluid dynamics to implement. However, this incurrs heavy computation power which makes them not suitable for real-time applications.

My project will be based on Koh Kok Weng's real-time dust rendering system and making dust fluids able to take on any arbitrary shapes. This will invovle transformation of geometric shapes base on the fluid movement. Thus, right now i'm researching on geometric shape changing papers and techniques that is applicable for my project. Apart from geometric transformation, realtime fluid solvers can be applicable as well.

Apart from looking through papers, i'm working on mel script interface as well. However the progress is slow as i'm still not familiar will mel script. At the same time, I'll be testing out on the codes and get familiarise with the framework that Cheng Teng has passed to me.

Friday, June 22, 2007

Geometric Computations in Parameter Space

Myung-Soo Kim, Gershon Elber, Joon-Kyung Seong, 2005
View paper: http://3map.snu.ac.kr/mskim/ftp/sccg05.pdf

Attended the seminar by Professor Myung-Soo Kim today about geometric computations in parameter space. He talked about how computation can be done more efficiently using surface and curve parameters instead of the 3D space x, y, z parameters.

Computations have been formulated for Minkowski sums, bisectors and a-sectors, surfacesurface intersections, collision detection, offset trimming, swept volume computation, constructing Voronoi diagrams, convex hulls and kernels, silhouette, and visibility computations. His paper presents some of these techniques and shows some simple examples of the computations.

Monday, June 18, 2007

A Real-Time Cloud Modeling, Rendering, and Animation

Joshua Schpok, Joseph Simons, David S. Ebert, Charles Hansen, 2003
view paper: http://www.ecn.purdue.edu/purpl/level2/papers/scaclouds.pdf

Overview

This paper introduces a multi-level, interactive, 3D cloud modeling and animation system using qualitative controls. The system allows animators to specify the type and the look of the clouds as well as specifying external forces such as wind and torque that affects the cloud's behaviour. This system allows artists to shape their clouds by positioning and sizing implicit ellipsoid primitives to create the cloud volume. The clouds form within these primitives in real-time, and the artists can see the result immediately.


The system uses a procedural approach in their cloud formation and animation. It is similar to Koh Kok Weng's(2005) real-time dust rendering approach. It uses noise functions and slicing geomatory technique to approximate the look of the clouds. The system makes use of transformation matrices to determine the texture coordinates in order to model the cloud movement.

Although the system allows users to specify cloud size and other attributes, the primatives are in terms of ellipsoids. Users cannot specify different shapes of the cloud. Also,final result of the cloud after manual adjustments can only be viewed after offline, high-quality rendering.

Thursday, June 14, 2007

H103020 Real-time Dust Rendering

Koh Kok Weng, 2005
view report: https://dl.comp.nus.edu.sg/dspace/bitstream/1900.100/2072/1/hyp.pdf

This report presents a real-time dust rendering pipeline that uses geometry deformation and shading to create the dust effect. Each dust particle consist of a spherical geometric mesh shaded with the dust shading system. Each particle has a velocity and a lifespan where it increases in scale, fades out and get destroyed. In order to create the dust effect, multiple particles are emitted from the emitting point and gets destroyed as it moves further away from the emitting point. The interface enables users to define the attributes of the dust and able to create other amorphous effects such as smoke and fire.

Currently, all particles are in the form of a spherical shape with slight deformation. This can be extended and further improved by having various other geometric shapes or a evolving geometric shape. For the purpose of my hyp, fluid solvers may be included to change the texture of the particles to create dust interaction effects with the surrounding. Real-time interaction may be incoporated as seen in Jos Stam 2000 paper, Interacting with Smoke and Fire in Real Time.

Interacting with smoke and fire in real time

Jos Stam, 2000
view paper:
http://delivery.acm.org.libproxy1.nus.edu.sg/10.1145/350000/341866/p76-stam.pdf?key1=341866&key2=4452103811&coll=GUIDE&dl=GUIDE&CFID=26876035&CFTOKEN=30301997

This paper introduces a fast fluid solver to model the flow of smoke or other amorphous effects in 2d and 3d. It is a powerful tool to enable users to interact with the fluid in real-time. Realistic swirls and flows of fluid can be modeled during the interaction. For the purpose of my hyp, this solver can be useful for implementing real-time interaction of the smoke with its surroundings.

Saturday, June 9, 2007

Target-Driven Smoke Animation

Raanan Fattal, Dani Lischinski, 2004
view paper: http://www.cs.huji.ac.il/labs/cglab/research/tdsmoke/tdsmoke.pdf

Overview
This paper presented a method for controlling animated smoke. Given a sequence of target smoke states, the method generates a smoke simulation in which the smoke is driven towards each of these targets, matching the target's shape. This is very similar to the Shi and Yu 2005 paper on Controllable Smoke Animation With Guiding Objects except on the method of maintaining the shape of the smoke and preventing the smoke from diffusing.

This paper's method consists of a driving force term that causes the fluid to carry the smoke towards a particular target, and a smoke gathering term that prevents the smoke from diffusing too much. However, the gathering term creates defects while the smoke is gathering.

Although the smoke is driven towards the target shape, there is no control over its quality and intermediate shape. Instead, the animator is provided with several parameters for controlling the rate at which smoke evolves, as well as other characteristics of the simulation.

Controllable Smoke Animation With Guiding Objects

Lin Shi, Yizhou Yu 2005
view paper: http://www-sal.cs.uiuc.edu/~yyz/publication/sobj_tog.pdf

Overview
The main focus of this paper is on controllability and appearance to match smoke surface to target shape surface. The model uses velocity constrains voxels to control the smoke movements and uses shape morphing and interpolation and shape masking to model the shape transitions of the smoke.

Users first defines an underlying guiding target object for the smoke to morph to. The smoke particles will morph into the shape of the underlying object by wraping around it. The smoke also interacts with each other and the environment in a natural and realistic way.




In order to achieve an amount controllability, the fluid dynamic rules have been relaxed. Although the model implemented here is faster than recent models that have been implemented, this is still not near real-time.

Right now I’ll remember the techniques used for shape matching here and will return to this article in the future for other useful techniques.

Friday, June 8, 2007

A Real-Time, Controllable Simulator for Plausible Smoke

Morgan McGuire 2006
view paper: http://graphics.cs.brown.edu/games/CartoonSmoke/mcguire-simulation-2006.pdf

Overview
Morgan uses a particle system approach to generate the smoke effect. At the same time, spherical vortices are dynamically created to affect the behaviour of the particles. Each vortex applies centripital acceleration and centrifugal or “suction” acceleration perpendicular to the vortex rotation and radial direction. Morgan also took into account of other external forces such as wind, gravity and drag that affect the particles' movement pattern. The simulator ignored the collision between particles so as to achieve faster calculation and real-time results.

As stated in the paper, the copying of particle data from CPU to GPU is slow. The simulation is non-realistic but that can be further improved. It is also difficult for artists to control the shape and movement of the smoke by defining the forces. The model does not fully use the rules of fluid dynamics and may have same visual defects. But in order to achieve fast calculation and real-time generation, some trade-off of the visual aspect can be justified.

Using vortices to affect the behaviour of the smoke can be useful in my project in order to achieve realistic and random effects. At the same time, some level of control over the particles within the vortices can be achieved.

A Controllable, Fast and Stable Basis for Vortex Based Smoke Simulation

Alexis Angelidis, Fabrice Neyre, Karan Singh, Derek Nowrouzezahrai, 2006
view paper: http://www-evasion.imag.fr/Publications/2006/ANSN06/smoke_sca06.pdf

Overview

The main objective of this paper is to provide animators with a framework for fast and controllable smoke that automatically maintains its chaotic behavior. In order to achieve this, the paper proposes filaments(control rings) for artists to control smoke movements. The model uses filaments to guide the smoke direction and these filaments’ velocity fields affect the smoke attributes and appearance at the same time.

The proposed model works with smoke particle system and it provides low-resolution editing with few particles for artists and high-resolution rendering that preserves the original motion. However, the rendering speed does not allow it to apply to real-time applications.

But for the purpose of my project, the control rings used in this paper can be adopted for use. These control rings can have additional inputs that governs the appearance of the surrounding smoke. It can control the direction and movement of the smoke without losing the smoke's natural look.