Doug Kavendek - Portfolio

Weathering

Weathering
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)
11.jpg
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.

09.jpg
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.

03.jpg
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.

12.jpg
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.

13.jpg
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.

23.jpg
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.


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