wecker@cookie.dec.com (DAVE TANSTAAFL WECKER) (10/28/86)
Several people have asked me to post a SHORT description of exactly what a ray tracing algorithm is.. so I'll try. Ray tracing is a technique for generating very "life like" images through one of the most compute intensive algorithms around. The basic steps are as follows: For each pixel on the screen: Set the pixel to black. Draw a vector from the position of your eye to the pixel. (Yes you can do steroscopic images by defining 2 eye positions) (a) Continue the vector until you hit something. Depending on the object you hit: Pass the vector through (with degradition along any RGB component, e.g. transmission of certain colors) applying any refraction coefficients for the object. Bounce the vector off of the object (with appropriate degradations and scatterings). If the object was a light source stop and back the vector out (back to the original pixel with computed RGB degradations) and add it to the pixel value. If the vector goes off the edges of the "world" throw it away. At this point you should have a bundle of vectors (bounced, scattered, bent). Take each new vector and recursively call (a) until you hit a maximum recursion depth. The cumulative value at the pixel is the correct RGB value to display (built up from all RAYS that hit that pixel on its way to your eye). That's pretty much it, there are however ALOT of got-ya's: - Usually, there is really no such thing as "black" so you you need to define an ambient lighting factor for all objects. - The algorithm above will give you the dreaded "jaggies" whenever there is a straight diagonal line in the picture. The images I sent out use a technique called "distributed ray tracing". This simply means that some number of rays are sent from the eye through the pixel (usually between 2 and 10) instead of 1. Each ray is slightly off center, so the net effect is to "blur" sharp edges avoiding the jaggies". - How many times do you let a ray bounce inside of a glass sphere before you give up on it? - Too many things to mention... you're all just going to have to wait until I get the AMIGA version completed.
nick@hp-sdd.HP.COM (Nick Flor) (10/29/86)
In article <6135@decwrl.DEC.COM> wecker@cookie.dec.com (DAVE TANSTAAFL WECKER) writes: <Deleted description of ray tracing> > > - Too many things to mention... you're all just going to have to wait > until I get the AMIGA version completed. No need to wait. hp-sdd!adp has had ray tracing on the Amiga for months. I don't know if he will release the source, but he knows quite a bit about ray-tracing in general (as he's been toying with it for the past 2 years or so). So, if you need more info, ie. book references, the binaries etc... you can try E-mailing him at: ..hplabs\!hp-sdd\!adp Nick -- + Disclaimer: The above opinions are my own, not necessarily my employers. / Nick V. Flor / ..hplabs!hp-sdd!nick / Hewlett Packard, San Diego Division * "What's going down in this world, you got no idea. Believe me." - The Comedian