Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!mimsy!oddjob!gargoyle!sphinx!drco From: drco@sphinx.UUCP Newsgroups: comp.graphics Subject: AmigaWorld Ray-Tracing Article Message-ID: <1514@sphinx.uchicago.edu> Date: Wed, 22-Apr-87 12:22:47 EST Article-I.D.: sphinx.1514 Posted: Wed Apr 22 12:22:47 1987 Date-Received: Fri, 24-Apr-87 03:44:16 EST Reply-To: drco@sphinx.UUCP (david lee griffith) Organization: U Chicago Computation Center Lines: 39 This is my first posting ever so please be patient. I do not currently own an Amiga (although my next student loan may go towards a 500 if it turns out to be as good as the propaganda says it is), but the postings about the AmigaWorld ray-tracing article interested me, so I bought a copy. The long and fruitless comparisons between the Amiga and the Cray seem to have obscured a crucial point about the program printed in the article. Namely that the ray-tracing algorithm given therein is really, really slooooow. 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. 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. 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 -- ...ihnp4!gargoyle!sphinx!drco Dave Griffith University of Chicago Mathematics Dept.