Doug Kavendek - Portfolio


Title Weathering
Date 2006
Created For Graduate Research Assistantship with H. Quynh Dinh
Documentation DOC, PDF, and TXT (103 KB)
Download source and Win32 (2.6 MB)
Overall erosion with residue collection in the center, where most particles would collect

As part of my Graduate Assistantship at Stevens Institute, I began working on a project dealing with the weathering of polygonal models. Our work used various methods proposed in several different papers, combining them with a few novel ideas, in order to create a realistic and easy-to-use weathering model. The weathering is controlled by the movement of particles within the simulation that will pick up and deposit mass, residues, and various other parameters around the scene. These particles obey simple movement and reflection mechanics, while getting pushed by a vector field representing a fluid flow.

Different settings in each viewport in splitscreen mode

I built the interface upon some previous framework code I had made (which was originally designed for Bumfight). The console, keyboard/mouse input, texture initializing, and other such routines were reused. Most of the new work focused on efficient rendering and partitioning of large models, particle interaction with model polygons, vector field subdivision and rendering, simulation structures, and allowing control over various weathering parameters so that the user can create various effects.

Collided polygons highlighted, and subset of bins used for collision detection shown

This simulation uses .PLY models for importing -- more information on this very open and extensible format can be found here. I have extended it slightly with a few extra model parameters, dealing with the hardness of the surface and the orientation of its faces (but they are not necessary, as importing non-extended model files just reverts to a default). Any number of models can be added to the scene.

The user can fire individual particles around the scene to see the various effects, but each particle has very little impact; it is only after many particles have traversed the scene that it begins to show a result. For this, a simulation can be run, with any number of waves of particles, such that a large number of particles are launched at the models in each wave. The effects are accumulated, and the models are recomputed for rendering. Parts of models that are interacting with particles will be subdivided, so that finer details from weathering can be shown. Parts of the model that do not interact with particles are not subdivided at all. Care had to be taken to preserve the integrity of the borders between subdivided and non-subdivided polygons, so as to not create excessively long triangles.

Resude collecting in the crevasses of the bunny

Additionally, there is always one active vector field in the simulation, and its effects can be modulated (or disabled entirely). It is imported from a .VF file, which is a very basic ASCII file format I made for these fields. This field can be subdivided on importing, or anytime during the program, to provide a more accurate field (the subdivision code was implemented by another student, Brandon Butch). This field can be visualized either with individual vectors for each element, or with planes sliced through the field orthogonally, rendered using a modification of the Image Based Flow Visualization (IBFV, by Jarke J. van Wijk). This latter method is significantly easier to look at and understand.

Polygon subdivision only in areas where particles collect

There are a few interface effects that I found fun to implement, even though they have pretty much no use in the program. For example, the user can switch to splitscreen view, and each viewport has its own individual rendering settings, along with a resizable grid. Also, just firing random particles from the camera around the scene (make sure to turn particle trails on first) can provide hours of amusement (or, well.. maybe five minutes). The console actually plays a rather useful role, in importing models and fields as well as in changing particular engine variables for when you can't remember which key to use. But that should not happen often, as there is also a keylist that can be toggled with F1, though most of its entries will probably make little sense to anyone besides me.

Dye traces in IBFV

I still think of this as being a work in progress, because it is fairly difficult for anyone other than myself to use it to get interesting results. Because it deals with very large numbers of particles and polygons, if you set some settings poorly, simulations may take an incredibly long time to run, and a balance always has to be made between polygon size, subdivision target, and bin size, or else the benefits of the partitioning will be negated. Mainly interface issues need to be worked out more elegantly, but that was not the focus of this project, so I just wasn't able to devote as much time to it.

Various particles bouncing about on the horse's back
Visualization of normals, with polygon wireframe and hidden surface removal
With lower elasticity, particles can adhere to surfaces, sliding down slopes
Strong ruts created with a softer model (mostly noticable on back)
Line representation of vector field. It is impossible to see inner vectors
Residue trails in a circular vector field
Sparse lines showing vector field
The lone IBFV rendering of the same field
Particles (with conserved momentum) in the vortex
Particles (without conserved momentum) in the vortex
Three planes in a vortex field
More particles in the vortex, but with a purely downward spiral
More dye traces in IBFV
A monstrous subdivision failure -- this was once a flat plane. This bug was thankfully fixed