Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!hc!hi!josh From: josh@hi.uucp (Josh Siegel ) Newsgroups: comp.graphics Subject: Re: ray tracing (Was Amiga ray tracer) Message-ID: <4947@hi.uucp> Date: Wed, 22-Apr-87 23:48:13 EST Article-I.D.: hi.4947 Posted: Wed Apr 22 23:48:13 1987 Date-Received: Fri, 24-Apr-87 23:49:32 EST References: <1514@sphinx.uchicago.edu> Reply-To: josh@hi.UUCP (Josh Siegel) Organization: U. of New Mexico, Albuquerque Lines: 99 I am going to throw out some more ideas. Maybe some great and new method could be generated right here... :-) In article <1514@sphinx.uchicago.edu> drco@sphinx.UUCP (david lee griffith) writes: > As written, the program will test for each pixel and each >sphere in the universe whether the line from the observer to the >patch of the perspective plane corresponding to the pixel intersects that >sphere. With 50 - 100 spheres in the universe, and 320x400 pixels >(or however many there are) that is a whole bunch of comparisons. >If each comparison requires two floating-point multiplications and >a subtraction, no wonder the program takes so long! Some sort of pre- >processing (a simplified Z-buffering comes to mind) should be included >so that only necessary comparisons are done and !!NO!! line-sphere >intersection tests should be done on pixels that turn out to be >background. Of course your programs are going to take hours if you use >such brute force techniques as using ray-tracing to do hidden surface >elimination. The Z-buffer will work nice except it doesn't help with shadows unless you do a full Z-buffer for each light source as well. How do we do shadows? Another idea would be just to draw 2D versions of all the objects and then see what is not drawn upon to find out what is the background. Also, since not ALL objects are reflective, we could just have it ray trace those objects that are special. Still, I don't know how texture mapping is done when you don't ray trace so I don't know how much this will help. The initial intersections are the easy part. It is when you have light bouncing off of lots and lots of different objects that slows it down. He doesn't even have a example of that! Think of a mirrored room with reflective spheres where the only color is a purple sofa. Yech! How about we divide the Universe into blocks that are 16 on a side. Every object that touches one of these "blocks" is put into a linked list for that block. This means we can move through the blocks and just look at the objects that touch that block. Saves us time checking intersection with every object. It also means that putting dense objects on the other side of the room won't slow down a sparse area at all.. Another question, how much of this could we do using integers or using logs. A add is much faster then a multiply. Any ideas on what could be done in this area? How 'bout the FFT work done from Carnegie-Mellon by Hans P. Moravec? ("3D Graphics and the Wave Theory", Computer Graphics, Volume 15, Number 3, Aug. 81). Has anybody continued this work on doing a whole ray traced image by using waves and FFTs? There are some nice sample pictures but it has been a bit since I have gotten any real information. > Other problems with the code are less obvious. Little things >like the fact that the color of a mirrorred sphere is irrelevent >(I want my jugglers to have golden balls to work with :-) ), and >that if a bright red light reflects off of a shiny surface the >highlights turn out white. I won't even talk about the really >unrealistic model of specular reflection. I don't think it is irrelevent but maybe not as needed. Personally, I think that a program should give you a choice if you wish to do specular reflection on a particular object. I bet it would speed things up if we didn't have to follow 3 rays per intersection for just relection because of specular reflection. (I am not sure if the amiga ray tracer does this) > In short, what we have so nicely listed in the article is >some really slow and sloppily conceived code. This would not bother >me except that an improved version of it is being made available for >commercial release. Please tell me that not all commercial Amiga >software is of this quality. Such a wonderful sounding machine Ah... BUT it was free! Actually, the fact that this is public domain makes it very nice. I have 2 or 3 ray tracers (depending on your definition of a tracer) in my directory and everyone is a bit different. One is less then 600 lines and does relection, refraction, specular reflection, and multiple light sources. You can also run each color on a different processor! It is a grand piece of software yet the guy didn't do what Dave Wecker did which is put his neck on the line. There is a lot out there... its just that people aren't willing to take their hard work and give it away. Lets give D. Wecker a hand! > > >-- >...ihnp4!gargoyle!sphinx!drco Dave Griffith > University of Chicago > Mathematics Dept. Actually, I am also interested in the data structures people are using. What structure are people using that facilitates objects conencted to objects, etc. -- Josh Siegel (siegel@hc.dspo.gov) (505) 277-2497 (Home) I'm a mathematician, not a programmer!