All pastes #123993 Raw Edit

Something

public text v1 · immutable
·published 2006-08-09 19:10 UTC
rendered paste body
Code documentation
Doug Kavendek
May 2006


Photons

The weathering is performed by the interaction of particles with the models in the program.  We will be calling them photons, as some of the motivation behind the project involved using particles in a manner similar to photon mapping.  The photons will move through the world, affected by various forces, from gravity, initial velocity, or the vector field.  Collisions with model faces will result in both geometric perturbations as well as adjustments to residues.  Model faces and photons can contain residues, which can then be spread around on the model, leaving traces behind.

Residue is just a measure of some kind of contaminant on a surface/particle.  There are structures for dirt, rust, and moss, but only moss is currently used, to demonstrate how it works.  A surface can be initialized to have specific residues, as a photon can be initialized with some residues.  Currently, faces start with no residue, and photons start with some moss, and so as photons move around, they deposit some moss.  Photons also will pick up residue from the surfaces they encounter.  The residue structure also records collision counts for given faces, for testing.

Photons can be fired from the camera.  In this way, there can be a large number of active photons at once.  They will move around in the world until they either land on a face or leave the extents.  Every time a model-photon collision occurs, there is a chance that the photon may land on the face, rat}