Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uwmcsd1!leah!bingvaxu!sunybcs!rutgers!okstate!mbc From: mbc@a.cs.okstate.edu (Michael Carter) Newsgroups: comp.graphics Subject: Re: Vectorizing ray-object intersection calculations Summary: ...object intersections aren't the problem ... Keywords: ray tracing, vectorization Message-ID: <3877@okstate.UUCP> Date: 29 Aug 88 14:19:57 GMT References: <594@fcs280s.ncifcrf.gov> Organization: Oklahoma State Univ., Stillwater Lines: 29 In article <594@fcs280s.ncifcrf.gov>, palmer@ncifcrf.gov (Thomas Palmer) writes: > > Has anyone done any work on vectorizing ray-object intersection > calculations? The vectorizing C compiler on a Cray X/MP will not > (automatically) vectorize loops smaller than about 5 or 6 iterations > (nor should it - the vector register load time outweighs the gain). > Typical ray tracing vector operations involve vectors of length 3 or 4. > The real problem in the inner ray tracing loop is not ray-object intersections, but ray-bounding volume intersections. If you refer to the article by Kay and Kajiya from SIGGRAPH '86, they describe a method of breaking down the OBJECT space into a hierarchical data structure, and intersecting rays against simple bounding volumes constructed from sets of planes. This method queries the objects in the order that they occur along the ray, therefore, NO SORTING IS NEEDED. It takes at lease three pairs of planes to completely enclose an object, therefore this intersection calculation could be done efficiently, in parallel (on perhaps more than one object at a time!) on a vector machine. Most of the time is spent in this ray- bounding volume intersection loop, and not in the ray-object intersection algorithms. I realize that this is not something that the C compiler can do on its own, but remember: no pain -- no gain. (-: -- Michael B. Carter Department of Electrical and Computer Engineering, Oklahoma State University UUCP: {cbosgd, ea, ihnp4, isucs1, mcvax, pesnta, uokvax}!okstate!mbc ARPA: mbc%okstate.csnet@csnet-relay.arpa