Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!ncar!unmvax!tut.cis.ohio-state.edu!rutgers!psuvax1!psuvm.bitnet!cunyvm!nyser!cmx!top.cis.syr.edu!gefuchs From: gefuchs@top.cis.syr.edu (Gill E. Fuchs) Newsgroups: comp.graphics Subject: Raytracing speedups.... Message-ID: <907@cmx.npac.syr.edu> Date: 14 Dec 88 21:32:21 GMT Sender: usenet@cmx.npac.syr.edu Reply-To: gefuchs@top.cis.syr.edu (Gill E. Fuchs) Organization: CIS Dept., Syracuse University Lines: 61 Hi... The following paragraphs describe an idea of mine. This idea describe a possible algorithm for improving speed for raytracing... Please note that this is not an algorithm yet. I would appreciate if anybody would let me know if this would be truly possible and if somebody else has thought of it already.... I appriciate any comments or suggestions... -vahid koussari koussari@rodan.acs.syr.edu gefuchs@top.cis.syr.edu ------------- This process describes a possible improvement for raytracing.... This method uses bounding boxes instead of bounding volumes to speed up intersection tests of objects. As with any basic raytracer, begin by reading in info about objects... But as you are reading world coordinate positions for objects using a 4 X 4 transformation matrix, transform the object center plus any point along the border (radius for sphere) to screen coordinates. For each all objects create an array which contains coordinates of opposite sides of a rectangle that bound that object. Note that this could be more optimized by that if after reading in all object descriptions and creating all bounding boxes, you can check to see if one boxes is inside another and so forth. If so, count the number of bounding boxes within each other and delete all the rest and keep the biggest one (topmost). Then set a structure equal to the number of objects that are included in that box. If there are more than one then set it equal to that number otherwise set it equal to 1. Now for the actual rendering... As you begin to render an image and create rays for all pixels on the screen, you check to see if the current screen(x,y) coordinate that is being processed is in side any of the bounding boxes. If it is not in anyof the boxes, then get the background color. If it is then intersect the ray with the spheres pointed to by the structure that holds what objets that exist inside that bounding box. ------------- Now for possible bugs... Would there be problems with secondary rays? (reflected,refracted) ------------- Further improvements if this works.... After doing the preprocessing, an array of bits could be setup that correspond to the resolution of the image... instead of checking to see if the x,y coordinate is inside a rectangle. you can just check to see if the appropiate bit inside the array is 1 or 0...if 0 then there are no objects at that point (get background) if 1 then process using the shader..... I have chosen rectangles instead of irregular polygons because it is easier to check for points inside rectangle than irreg. polygons. ----------------------------------------------------------------------- #! rnews