Space Subdivision Algorithms for Ray Tracing

Size: px
Start display at page:

Download "Space Subdivision Algorithms for Ray Tracing"

Transcription

1 Spac Subdivision Algorithms for Ray Tracing by David MacDonald A thsis prsntd to th Univrsity of Watrloo in fulfillmnt of th thsis rquirmnt for th dgr of Mastr of Mathmatics in Computr Scinc Watrloo, Ontario, 1988 David MacDonald 1988

2 I hrby dclar that I am th sol author of this thsis. I authoriz th Univrsity of Watrloo to lnd this thsis to othr institutions or individuals for th purpos of scholarly rsarch. Signa,ur I furthr authoriz th Univrsity of Watrloo to rproduc this thsis by photocopying or by othr mans, in total or in part, at th rqust of othr institutions or individuals for th purpos of scholarly rsarch. Signatur (Ü)

3 Th Univrsity of Watrloo rquirs th signaturs of all prsons using or photocopying this thsis. Plas sign blow, and giv addrss and dat. (iii)

4 Abstract Ray tracing provids computr rndring of synthtic imags with many ralistic qualitis, but is computationally xpnsiv. Ray tracing rquirs tsting of rays against a scn to s which objcts, if any, ar intrsctd. Th high numbr of such tsts rquird by typical ray tracrs contributs significantly to th computational xpns of ray tracing. An fficint mthod of rducing th computation involvd in th intrsction tsts is to organiz th objcts composing th scn into on of svral typs of hirarchical data structurs. This thsis dscribs algorithms for th construction, storag, and travrsal of th spac subdivision hirarchy. Mthods ar suggstd for dcrasing computational rquirmnts of th data structur with rspct to ths thr aras. On suggstd stratgy for improving prformanc in all thr aras (construction, storag, and travrsal) is implmntd for th bintr structur. Th prformanc of ths simulations is compard with implmntations of contmporary mthods and som fficincy gains ar shown. Furthr work is suggstd, including adaptation of som of th idas prsntd within this thsis to mor gnral typs of hirarchical structurs. (iv)

5 Acknowldgmnts I would lik to thank Kllogg Booth for suprvising m during th cration of this thsis. I am vry gratful for his suggstions and ncouragmnts throughout my stay at th Univrsity of Watrloo. I am indbtd to my two faculty radrs, Charls Colbourn and Drick Wood, and to my studnt radr, Stwart Kingdon. Thir commnts and criticisms addd gratly to th quality of this thsis. I sincrly apprciat th financial assistanc providd thoughout my graduat studis by th Natural Scincs and Enginring Rsarch Council. This thsis is ddicatd to my frinds. (v)

6 Tabl of Contnts 1 Introduction Introduction to Ray Tracing Background Rays and Plans Bounding Volums Hirarchical Data Structurs Objct Hirarchis Volum Hirarchis (Spac Subdivision) Static Vrsus Dynamic Structurs Multiprocssor Algorithms Prvious Spac Subdivision Algorithms Glassnr Glassnr Construction Glassnr Storag Glassnr Travrsal Kaplan Kaplan Construction Kaplan Storag Kaplan Travrsal ARTS ARTS Construction ARTS Storag ARTS Travrsal Improvmnts Construction Th Surfac Ara Mtric (vi)

7 3.1.2 Objcts Spanning th Slicing Plan Optimal Trs Spatial Mdian Subdivision of Point Objcts Arbitrary Subdivision of Point Objcts Evaluation of Glassnr Octr Construction Mthod Arbitrarily Orintd Splitting Plans Scn Complxity and Efficincy Load Balancing in Multiprocssor Algorithms Storag Multiprocssor Implmntation Storag of Voxl Dimnsions Storag of Objct Lists Travrsal Prcomputation of Intrsction Distancs Exit Point Computation Multi ray Travrsal Expandd Lavs Implmntation Surfac Ara Mtric Vrification Construction Algorithms Scns Nighbour Links Rsults Construction Algorithms Nighbour Links Summary Suggstd Furthr Work (vii)

8 Rfrncs Appndix A Graphical Rsults of Construction Algorithms Objcts Lavs Nods... I l l Larg Scns O bjcts Lavs...» Nods... Appndix B Varying th Numbr of Objcts Larg Trs (viii)

9 List of Tabls Tabl (ix)

10 List of Figurs Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur Figur (x)

11 Chaptr 1 Introduction On popular algorithm for computr rndring of synthtic imags is ray tracing. Th main rason that th us of ray tracing is so widsprad is th simplicity of coding and comparativ as with which ray tracing rndrs many ralistic ffcts, including shadows, pnumbra, rflction, rfraction (transparncy), and motion blur. Th principal drawback of ray tracing is its comparativly high computational cost, which is du primarily to th high occurrnc of on basic opration, th ray-scn intrsction tst. This computation can b xprssd as answring th qury: givn a scn comprising a st of objcts and a ray dfind by an origin point and a dirction vctor, dos th ray intrsct som objct, and what is th first (closst) objct intrsctd? Othr information may also b rquird if an objct is intrsctd, such as th point of intrsction and th normal to th objct s surfac at th point of intrsction. Th computing of ray-scn intrsctions has traditionally bn spdd up by many mthods. Som hybrid algorithms rduc th numbr of intrsction computations rquird by combining ray tracing with othr typs of rndring, such as standard scan-convrsion tchniqus. Othrs rduc th numbr of such computations by mor fficint ray tracing, minimizing th numbr of rays tracd. Still othrs us paralll procssors to prform mor than on intrsction computation at onc. Whil th mthods mntiond abov rduc th cost of ray tracing by cutting down th numbr of intrsction computations, non of thm actually spd up th basic ray-scn intrsction tst, which is th issu addrssd by this thsis. Th simplst, brut forc mthod of dtrmining th ray-scn intrsction is to tst th ray against ach objct, rmmbring which objct, 1

12 2 if any, has th narst point of intrsction. This has bn vastly improvd with th us of scn structuring [Rubi80], [Wgh84], [Glas84], [Kapl85], [Kay86], [Fuji86], [Glas87c], [Gold87], [Glas88]. Scn structuring rlis on th fact that th intrsction tst is basically a multi-dimnsional sarch. It can b spdd up by us of a sarch tr, which imposs an ordring upon th objcts comprising th scn. This ordring rducs th numbr of rayobjct intrsction tsts rquird. Bfor furthr discussion of sarch trs for ray tracing, an introduction to th ray tracing algorithm is warrantd. Th nxt sction provids a vry brif ovrviw of ray tracing. A good in-dpth introduction to ray tracing may b found in [Glas87a] Introduction to Ray Tracing Th imags a prson ss ar cratd by nrgy manating from light sourcs, bouncing off objcts in th nvironmnt, and hitting his or hr y. A computr gnratd imag of a givn scn can b obtaind by placing an imaginary ypoint and a viwing scrn into th thr dimnsional scn of objcts. Th scn is mappd onto th viwing scrn by following rays of light laving th light sourcs, bouncing off objcts, through th scrn, and into th imaginary y. Howvr, it is much too xpnsiv to trac rays in this way from th light sourc following thir paths as thy bounc off and travl through objcts, bcaus th small probability of a givn ray vntually hitting th y rquirs such a larg numbr of rays to b tracd that infinit rsourcs would b rquird. Thrfor standard ray tracing algorithms trac rays backward from th y, through th scrn, to th scn. Th colour of ach pixl of th imag is dtrmind indpndntly from othr pixls, by tracing a ray from th y through th corrsponding virtual pixl on th viwing scrn, and computing what objct, if any, it hits. Basic modls of surfac physics ar

13 3 usd to dtrmin th colour and intnsity of light travlling from th intrsction point to th y, and thrby colouring th pixl in qustion. Th computation of light colour and intnsity typically involvs th surfac normal at th intrsction point, th y vctor (dirction to th y from th point), th light vctors (th dirctions to th light sourcs from th point), and th intnsity of light hitting th point from th light sourcs, this last trm accounting for shadows. In most ray tracrs, th intnsity of light hitting a point from any particular light sourc is st to zro if th point is shadowd by an opaqu objct, and st to th intnsity of th light sourc othrwis. To chck if an objct is in shadow, a ray-scn intrsction tst is prformd to dtrmin if thr is any opaqu objct intrsctd by th ray from th point of intrsction to th light sourc. Mor complx ray tracrs modl othr ffcts such as rflction and rfraction by tracing additional rays which rprsnt backward rflction and transmission of th original ray. Ths rays may rcursivly spawn othr rflction and transmission rays in attmpts to provid a mor ralistic modl. Many antialiasing tchniqus rquir sampling of xtra rays. Th gnral rul in ray tracing is that incrasd ralism and pictur quality rquirs mor rayscn intrsction tsts, indicating an obvious motivation for fforts to rduc th cost of ray-scri intrsction computations. This thsis xamins mthods to rduc th cost of ray-scn intrsction tsts through th us of spac subdivision hirarchis. Various algorithms to improv prformanc ar advancd.

14 Chaptr 2 Background This chaptr provids som background ncssary for th discussion of spac subdivision for ray tracing. It bgins with th basic gomtry and algbra of rays and plans, and thn introducs th ida of a bounding volum. Nxt a dscription of th two major hirarchical data structurs for ray tracing is givn, with mphasis on spac subdivision hirarchis. Finally, a survy of prvious work on spac subdivision is prsntd Rays and Plans A ray is dfind by a point origin and a dirction vctor, both of which consist of thr coordinats. A ray consists of all points which ar th sum of th origin and a non-ngativ multipl of th dirction vctor. A ray can b xprssd in th form: R (t) = (Rx,Ry,R2) = O+t-D, whr 0 < t = th paramtric distanc along th ray O = (0x,0 y,0 2) = Origin of ray R D = (Dx,Dy,Dz) = Dirction vctor of ray R 4

15 5 A plan can b dfind by a normal to th plan and a distanc from th origin. An quation dfining a plan is: whr NP-d = 0, rprsnts dot product N = (NxNyNz) = th unit normal vctor to th plan d = distanc of plan from origin P = (PxPyP2) = any point on th plan Th plan consists of all points P which satisfy this quation. Th intrsction of a ray with a plan can b obtaind by first dtrmining th valu of th paramtr t of th ray whr th ray intrscts th plan, thn substituting this into th quation of th ray, to find th intrsction point. Th valu of t may b calculatd with th following quation: d-n O 1 ~ N D If N D is zro, thn th ray is paralll to th plan and ithr dos not intrsct th plan or is mbddd in it. In th cas whr th plan in qustion is prpndicular to ithr th x, y, or z axis, th quation is simplr (no dot- product), as in th following cas, whr w assum th normal is (1,0,0): d -O x t = ----, whr x = d is th simpl form of th quation of th plan Sinc w ar daling with ths typs of plans xtnsivly, lt us trm a plan that is prpndicular to a major axis (jc, y, or z) a major plan.

16 Bounding Volums Scns ar modlld with a varity of diffrnt implicitly and xplicitly dfind objcts and surfacs. Thy rang from simpl objcts, such as sphrs, llipss, triangls, polygons, and paralllpipds, to mor complx surfacs such as cubic patchs, splin surfacs, and implicit functions. For all but th simplst of ths, an intrsction tst of a ray with th objct is a nontrivial computation. To spd up th intrsction tst, a bounding volum is placd around th objct. Th bounding volum is typically a vry simpl typ of objct with an asy intrsction tst, such as a sphr or a paralllpipd which has sids prpndicular to a major axis (boundd by major plans). In ordr to dtrmin if a ray intrscts a particular objct, th ray is first tstd against th objct s bounding volum. If th ray dos not intrsct th bounding volum, it is obvious that it dos not intrsct th objct insid, and th intrsction tst is finishd. If th ray dos intrsct th bounding volum, th ray must b tstd against th objct in th usual mannr. In this way, th bounding volum is usd as a tst for trivial rjction of a ray-objct intrsction. Th typ of objct chosn as bounding volum must hav a sufficintly simpl ray intrsction tst, yt must also provid a tight fit around th objcts to b nclosd. Th bounding volum must b tight nough around th objcts that nough rays ar trivially rjctd to provid savings at last as grat as th incrasd cost of computing th ray-bounding volum intrsction tst. A common typ of objct for bounding volums is a rctangular paralllpipd (ach sid is prpndicular to a major axis). Th spcification of this typ of bounding volum (hraftr rfrrd to as a box) rquirs only six valus, a low and high valu for ach of th thr coordinats. Th intrsction tst of a ray with a box is quit simpl, ssntially clipping th ray against

17 7 th box. It involvs finding th rang of th paramtric valu t for which th ray is within th box. If th rang is mpty, th ray dos not intrsct th box. A non-mpty rang indicats intrsction. A simpl coding of this algorithm is givn in Figur 2.1. Computation of a box bounding volum is usually a simpl opration also. Th tightst fitting box for any objct is dfind by th maximum and minimum coordinat valus for ach of th thr coordinats. For most xplicitly dfind objcts and surfacs, including polygons, sphroids, and paralllpipds, this rprsnts a vry straightforward computation Hirarchical Data Structurs Scn structuring is usually accomplishd with a hirarchical data structur. Thr ar two main classs of hirarchy applicabl to ordring th scn, which ar duals of ach othr. Th objct hirarchy subdivids th objcts composing th scn, rcording th spac that ach objct inhabits. Spac subdivision, or volum hirarchy, subdivids spac, rcording th objcts that inhabit ach rgion of spac Objct Hirarchis An improvmnt ovr th xhaustiv sarch of th ray with a st of objcts is to comput a bounding volum nclosing all of th objcts in th st. Thn, any rays which do not intrsct th bounding volum can b rjctd, thrby introducing som savings. Additional savings can b obtaind by dividing th objcts into two groups, and for ach group, computing a bounding volum nclosing all of th objcts in th group. A ray is tstd against ach bounding volum and if it dos not intrsct, th nclosd objcts nd not b tstd. Th improvmnt hr is a rsult of somtims bing abl to quickly rjct half th objcts (or all of thm, in som cass) from th intrsction tsts.

18 FUNCTION RayBoxIntrsct( RayOrigin, RayDirctlon, Box ) : BOOLEAN; CONST Dimnsions = 3; VAR tmln, tmax, tlow, thigh, tntr, txlt : REAL; BEGIN (* st th rang o f t to [O..+00] *) tmln := 0; tmax := +0 ; FOR coord := 1 TO Dimnsions DO IF RayDirctlon[coord] <> 0.0 THEN (* calculat th rang of t btwn th two paralll plans, stor in tlow, thigh *) tl := (Box[1.coord] - RayOrigin[coord]) / RayDirctlon[coord] t2 := (Box[2,coord] - RayOrigin[coord]) / RayDirctlon[coord] tlow := MIN( tl, t2 ) ; thigh := MAX( tl, t2 ); (* gt intrsction o f rang so far, and rang [tlow..thigh] *) tmln := MAX( tmln, tlow ); tmax := MIN( tmax, thigh ); ENDIF; ENDFOR; (* if intrsction occurs forward of origin AND th rang is nonmpty, thn thr is an intrsction *) IF tmln <= tmax THEN RETURN TRUE; ELSE RETURN FALSE; ENDIF; END RayBoxIntrsct; Figur 2.1.

19 9 Givn th spd gain in dividing a group of objcts into two, it sms rasonabl that vn mor gains would rsult from subdividing ach of th two groups into smallr groups. A hirarchical xtnts tr (hraftr rfrrd to as an HE tr) ffctivly provids a rcursiv subdivision of objcts in this mannr ( xtnt is just anothr nam for bounding volum). This typ of hirarchy is oftn trmd an objct hirarchy. Th root of th tr corrsponds to a bounding volum containing all of th objcts in th scn. Th childrn of a nod corrspond to a st of bounding volums that divid th objcts containd in th nod s bounding volum. Whn th numbr of objcts in a nod s bounding volum is on, th nod is givn a singl child whr th objct is actually stord. Although rfrnc is mad to objcts nclosd by, or containd within, a nod s bounding volum, it should b obsrvd that objcts ar actually only stord in th lavs. An xampl of a small scn and a simpl HE tr is givn in Figur 2.2. Givn a ray and an HE tr, th intrsction algorithm is a simpl rcursiv procss. Th ray is tstd against th root nod s bounding volum and, if it intrscts th bounding volum, th childrn ar rcordd as candidats for tsting. This tst is rcursivly applid to all childrn of any nod intrsctd, thrby travrsing th part of th tr whr possibl intrsctions with an objct might occur. Whn a laf nod is ncountrd, th ray is tstd with th objct stord in th laf, and th narst intrsction of a ray with an objct is rcordd during th travrsal. This algorithm can oftn b spdd up by ordring th nods to b tstd according to th narnss of intrsction with th nods bounding volums. Th fficincy of th tr dpnds highly on th choic of bounding volums during subdivision. In ordr to obtain an fficint HE tr, th subdivision procss should divid a group of objcts such that th corrsponding bounding volums ar as small as possibl and do not ovrlap. An indication of th validity of th scond constraint ariss from looking at th xtrm cas

20 10 Figur 2.2 Lttrs a through g rprsnt th objcts. Numbrs 1 through 5 rprsnt intrior nods. of ovrlap whr all of th childrn of a nod hav th sam bounding volum, which would hav to b th sam as that of th parnt. In this cas, it can b sn that th subdivision into childrn has ffctivly not subdividd th objcts at all. If a ray intrscts th parnt nod, it must intrsct all of th childrn, giving no savings. Th validity of th first constraint, using small bounding volums, is mor apparnt. Smallr bounding volums ar lss likly to b intrsctd by a ray, and thrfor rsult in trivial rjction

21 11 mor oftn. Basd on ths obsrvations, any algorithm for constructing an HE tr should b dvisd with a goal of minimizing th siz and ovrlap of bounding volums. Bcaus many systms dfin a scn in a hirarchical format, arly HE tr construction tchniqus simply chos th bounding volums dfind by th groupings of th objct hirarchy. This provd to rsult in quit infficint trs, so othr typs of algorithms for gnrating fficint HE trs ar now bing xplord. Exampls of ths algorithms may b found in [King86] and [Gold87] Volum Hirarchis (Spac Subdivision) Objct hirarchis rcursivly subdivid th objcts into disjoint substs, rcording th spac inhabitd by ths substs. Th dual of this is spac subdivision, which subdivids th objct spac into disjoint subrgions, rcording th objcts which inhabit ths substs of spac. To s how this is don, lt us xamin th octr, a common typ of spac subdivision hirarchy, or volum hirarchy. Initially, th tr consists of only on nod, rprsnting th bounding volum containing all of th objcts in th scn, xactly th sam as th root of an HE tr. Using thr slicing plans (on prpndicular to ach of th thr major axs), th bounding volum is dividd into ight smallr ons. Eight childrn of th root ar cratd (hnc octr), on for ach nw bounding volum, and ach objct is placd in whichvr child ncloss it. This spac subdivision can b sn in Figur 2.3. Each of th childrn may b rcursivly subdividd. If a nod contains no objcts, thn thr is no advantag to subdividing it, and thrfor, only nods containing objcts ar subdividd. Th bounding volums associatd with nods ar usually rfrrd to as voxls, which is th thr-dimnsional analog of a pixl. Somtims an objct blongs in mor than on voxl. In this cas, on obvious tchniqu is to split th objct into nw objcts that do

22 12 not blong in mor than on nod s voxl. Howvr, this can b vry costly in trms of tim and spac rquirmnts, so usually th objct, or a pointr to th objct, is stord in both nods [Glas84], [Kapl85], [Fuji86]. This tchniqu introducs problms, which ar discussd latr. As with th HE tr, whn th octr subdivision procss is complt, th rsulting structur has all of th objcts stord in th lavs, and non in th intrior nods. Howvr, unlik th HE tr, a singl laf may contain mor than on objct. Figur 2.4 illustrats a simpl scn and an octr rprsntation of it. Th ray intrsction algorithm for an octr may b implmntd as a rcursiv procss vry similar to that of th HE tr. If a ray intrscts th root nod, it is tstd against ach of th childrn. This is rcursivly applid to th childrn of intrsctd nods similar to th HE tr algorithm. Whn a laf nod is ncountrd, all of th objcts stord in it ar tstd for intrsction, and th narst, if any, is rcordd. Th octr allows tsting nods in th ordr that th ray passs through thm bcaus it subdivids spac into

23 13 disjoint rgions. Thrfor th algorithm halts as soon as it finds a laf which has an intrsctd objct. This is an advantag ovr th HE tr. Although th HE tr may b travrsd in ordr of most likly intrsction, th algorithm cannot b haltd as soon as a laf with an intrsctd objct is found, bcaus th objcts containd in th nods may ovrlap.

24 14 Th choic of slicing plans for ach axis of subdivision in an octr may b any arbitrary plan within th currnt box, or may b th plan that is halfway btwn th sids of th box (th spatial mdian), as is th cas in Figurs 2.3 and 2.4. Choosing th spatial mdian mans that th positions of th plans nd not b stord in ach nod, bcaus thy can b gnratd from knowing th limits of th nod. Th tradoff hr is mor compact storag in rturn for a rstriction on th subdivision procss. Travrsing a spatial mdian octr is analogous to prforming a binary sarch of spac, sinc th sarch rang is slicd in half at ach nod. Thr is an important clarification to b mad concrning th dtrmination of whthr a crtain objct blongs in a givn nod of an octr. An objct blongs in a nod only if th surfac of th objct intrscts th nod s box. Th rason for this is that th point of intrsction of a ray with an objct cannot occur within a box that dos not contain som part of th surfac. Considr th objct and box in Figur 2.5. Th box is ntirly within th objct. Rays can only intrsct th objct outsid this box. Thrfor th objct nd not b stord in th nod associatd with th box, bcaus th intrsction of th ray with th objct will b corrctly found in som othr nod which contains part of th surfac of th objct. Octrs hav a problm during travrsal pculiar to spac subdivision hirarchis. Dpnding on th implmntation, an objct may b stord in mor than on nod, and may not ncssarily b totally nclosd by any particular nod. Thrfor, an intrsction tst of a ray with an objct may find an intrsction point outsid th currnt nod. Th algorithm as dscribd would assum that this is th narst point of intrsction and halt. Howvr, bcaus th intrsction point is outsid th nod, w hav no guarant that thr is not a closr intrsction point with som othr objct in th scn.

25 15 Th solution is to always chck a ray-objct intrsction point to s if it is within th nod currntly bing xamind. If it is not, w ignor th intrsction point. This solution raiss anothr problm, that of tsting a ray with th sam objct mor than on tim. This infficincy may b corrctd by a ray-objct cach, indicating whthr th intrsction tst has bn prviously prformd, and what th rsult was. Th two-way analog of th ight-way octr is th k-d tr or bintr [Sam84]. Th only diffrnc is that whr th octr divids a nod into ight subnods, using thr splitting plans, a bintr divids a nod into only two subnods, using just on splitting plan. Any octr can b rprsntd by a corrsponding bintr. Th subdivision of a nod in an octr can b rprsntd by 3 lvls of subdivision of a nod in a bintr. This is dmonstratd in Figur 2.6. Thr ar a coupl of advantags of bintrs ovr octrs. Although any octr can b rprsntd by a bintr, not all bintr subdivisions can b rprsntd xactly by an octr. Bintrs can thrfor rprsnt a largr

26 16 Figur 2.6 x, y, z rprsnt splitting plans 1 through 8 dnot corrsponding childrn in octr class of subdivisions than octrs. (It should b notd, howvr, that an arbitrary bintr subdivision can b accomplishd with a dgnrat octr, but possibly with rgions of zro volum so that it is not xactly th sam dcomposition). Also, bintr algorithms tnd to b simplr than thos of octrs. This stms from th complxity of daling with thr simultanous slicing plans pr nod, in th cas of th octr, as compard to only on slicing plan, in th cas of th bintr. Thrfor, it is oftn mor convnint and mor fficint to us bintrs for spac subdivision [Kapl85] Static Vrsus Dynamic Structurs In computr animation, it is common for scns to chang from fram to fram, as objcts appar, disappar, and chang position, shap, colour, and othr attributs. It is oftn dsirabl to allow th data structurs ordring th scn to b updatd to rflct ths changs, rathr than to rbuild th ntir structur for ach diffrnt fram of th imag. An important issu whn choosing a data structur to rprsnt scns is whthr th structur allows dynamic modification as th scn changs, and whthr th dynamic modification is mor fficint than rbuilding a static structur ach tim th scn changs. Th issu of dynamic structurs gratly adds to th complxity. Th rmaindr of this thsis dals only with static structurs, laving th xtnsion to dynamic structurs an issu for latr rsarch. Th rstriction to static

27 17 structurs is not unrasonabl, as static structurs ar appropriat in cass whr th viwpoint changs oftn compard to th objcts in th scn, or in vry complx scns or complx ray tracing algorithms, whr th hirarchy construction tim is insignificant compard to that consumd by th tracing of rays. Th discussion of static issus may provid a rasonabl foundation on which to bas a tratmnt of dynamic structurs. On spcific mthod of daling with dynamic objcts is to trat tim as simply anothr dimnsion, with th data structur subdividing th objcts in 4-spac. Issus of this natur ar not includd in th discussions of this thsis, but xtnsion to four or mor dimnsions is possibl. A similar xtnsion to 4 dimnsions by Glassnr [Glas88] was succssful Multiprocssor Algorithms Thr hav bn many dsigns for ray tracing on multiprocssor machins, ach splitting th load ovr multipl procssors in a diffrnt way. Ths mthods can b partitiond into two main groups, basd on how th work is dividd among th various procssors. Imag spac algorithms assign diffrnt subrgions of th imag spac (groups of pixls) to diffrnt procssors, rquiring th ntir scn dscription to b availabl to ach procssor, which computs its part of th imag indpndntly from th othr procssors. Objct spac algorithms assign diffrnt parts of th objct spac (th scn) to diffrnt procssors. Each procssor ffctivly acts as a laf in a spac subdivision stratgy and only stors th objcts within its particular subvolum of spac. Th passag of rays through subvolums of spac rquirs additional communication ovrhad in th form of mssags from th procssor that a ray is in to th nxt procssor. An important considration in all multiprocssor algorithms is load balancing, which is th procss of maximizing throughput by nsuring that all procssors prform approximatly qual amounts of work so that procssor

28 18 idl tim is minimal. Load balancing appars in a static form and a dynamic form. Static load balancing attmpts to divid th workload vnly among th procssors bfor ray procssing starts. Dynamic load balancing monitors th workload of th procssors and changs th partitioning of th work if th workload bcoms too unbalancd. Again, tratmnt of multiprocssor issus would gratly complicat th discussion, so xtnsion of th idas of this thsis to multiprocssor algorithms is mntiond to a vry limitd xtnt. [Dipp84] and [Nmo86] provid tratmnt of spac subdivision issus on multiprocssors Prvious Spac Subdivision Algorithms Octrs and bintrs hav bn usd to spd up ray tracing with considrabl succss. Svral paprs dscribing th tchniqus and rsults hav appard in th litratur. A survy of thr paprs rlating to octrs and bintrs is prsntd hr, with concntration on thr aspcts of th algorithms: construction, storag, and travrsal of th structurs. Th rmaindr of this thsis xamins th issus of spac subdivision hirarchis with rspct to ths thr aras G lassnr 1984 Andrw Glassnr has publishd svral paprs daling with spac subdivision structurs for ray tracing. His first papr [Glas84] rprsnts on of th arlist publishd applications of octrs to ray tracing. His two latr paprs [Glas87c] and [Glas88] xpand upon th idas within this first papr but many of th basic concpts rmain th sam. Th following sctions primarily dscrib Glassnr s original octr.

29 Glassnr Construction Glassnr implmntd an octr which slcts th spatial mdian slicing plans. This provids for a straightforward subdivision procss, bcaus no algorithm is ndd to dtrmin which plan should b usd to subdivid a givn nod. His mthod of construction of th octr is a simpl bradth first tchniqu. Nods which hav mor than a crtain numbr of objcts ar subdividd, until a crtain siz of tr is rachd. Th tr building is govrnd by two paramtrs: th maximum numbr of nods and th thrshold valu usd for dtrmining whthr to split. Th thrshold valu is som small numbr gratr than or qual to 1. Using a thrshold valu to govrn subdivision is simpl and straightforward, but dos not ncssarily subdivid th nods that nd it most. For instanc, imagin a tr that has a fw objcts (lss than or qual to th objct thrshold) in a nod with a larg bounding volum, and many objcts in a nod with a small bounding volum. Glassnr s algorithm subdivids th smallr volum, rathr than th larg nod. Howvr, du to its rlativ siz, it is likly that only a fw rays go through th small nod, whil many intrsct th larg nod. Thrfor, subdividing th smallr givs vry littl prformanc gain. It is bttr to subdivid th largr nod. Glassnr s algorithm fails to crat a bttr tr bcaus it dos not xplicitly tak into account any masur of th chanc of a ray intrscting a nod. Glassnr sms to hav rcognizd this, bcaus, in a mor rcnt papr, h uss an improvd algorithm [Glas87c]. H outlins a mthod whrby a nod is subdividd if it contains mor than a thrshold numbr of objcts, or is largr than a givn volum. This mthod, although an improvmnt, is not vry satisfactory as it sms that th choic of thrshold is vry critical to th prformanc of th tr. Slcting a thrshold to obtain optimal prformanc for a givn scn is difficult. In Chaptr 3, an algorithm which prforms this slction dynamically is proposd.

30 Glassnr Storag Glassnr assigns to ach nod in th octr a uniqu intgr idntifir basd on th position of th nod in th tr. Th root is assignd th valu 1, and ach nod u, is assignd th idntifir p i, whr p is th idntity of th parnt and i (1 < i <8) indicats which of th ight childrn u is. Thrfor th childrn of th root would hav th idntifirs 11 through 18. Th nods ar stord in a hash tabl, in blocks of ight siblings to consrv mmory. Th idntifir of th parnt of a givn nod is hashd to giv th position in th tabl of th block of ight siblings. Th dsird nod is found by using th last digit of th nod s idntifir as an indx into th block. Collisions ar rsolvd by sparat chaining. Th information that is actually stord for a nod is th id numbr, a subdivision flag indicating whthr or not it is a laf, th cntr (splitting plans), dimnsions of th nod, and an objct list pointr. Th dimnsions of th nod may b omittd and gnratd from th splitting plans as th tr is travrsd, trading spd for storag. Similarly, if a spatial mdian schm is usd, th cntr fild may also b omittd and gnratd as th tr is travrsd. Th objct list pointr points to a list of objct indics which constitut th list of all objcts blonging to th nod. In Glassnr s implmntation, it is just an indx into an array containing objct indx lists for all nods. Each list is trminatd by a prdfind nil valu Glassnr Travrsal Glassnr utilizs two basic procdurs in th travrsal of an octr. On procdur is givn a point (x,y,z) and rturns th laf nod which contains this point. Th othr procdur taks a laf nod, and rturns a point (x,y,z) just byond th point of xit of th ray in qustion. Th point rturnd is computd so as to guarant that it is within th nxt laf nod along th ray. A travrsal calls ths two functions, altrnatly using th output of on as

31 21 th input of th othr. This numrats th laf nods intrsctd by th ray in ordr of narnss to th ray origin. Th objcts within th numratd lavs ar tstd for intrsction, and th algorithm halts at th first laf with an intrsctd objct. Th first procdur starts at th root nod, with nod idntifir st to 1. By comparing th givn point with th splitting plans stord at th nod, it dtrmins th id of th child in which th point blongs. Th child nod is found in th hash tabl, and if th subdivision flag is st, thn th procdur is rpatd bcaus th nod has childrn. Evntually a laf nod is found, which is rturnd as th laf containing th point. This mthod of finding a nod rquirs intgr multiplications and divisions, as wll as a ral comparison, for ach nod in th path to th laf. Sinc two conscutiv lavs along th path of a ray gnrally shar svral nods on thir paths, Glassnr s approach is infficint, sinc it dos not us this information to find lavs. Bcaus th ray xit point can b usd to dtrmin a uniqu nxt laf id, a simpl optimization of Glassnr s travrsal algorithm is to prform a binary sarch for th nxt laf. Th othr procdur, which finds a point in th nxt laf, prforms an intrsction tst of th ray with th laf voxl to find th t valu of th ray at th xit point. This valu is usd to gt th coordinats of th point of xit. Thn a small offst is addd to ach coordinat whos corrsponding sid of th voxl contains th point of xit. This small offst is simply half th minimum lngth of th dgs of all voxls in th tr, which is rcordd during construction. By adding this offst to th point of xit, Glassnr crats a nw point which is within th boundary of th nxt laf, but not on th boundary, thrby avoiding rporting mor than on laf nod. This procdur is vry similar to th ray-box intrsction tst, as is illustratd by th simpl coding of th xit point algorithm givn in Figur 2.7.

32 PROCEDURE RayBoxExit( RayOrigln, RayDirction, Box, VAR Exit : Point ) CONST Dimnsions = 3; VAR tmin, tmax, tlow, thigh, tntr, txlt : REAL; BEGIN (* st th rang o f t to [0 to + ] *) tmin := 0; tmax := +n>; FOR coord := 1 TO Dimnsions DO IF RayDirction[coord] <> 0.0 THEN (* calculat th rang o f t btwn th two paralll plans, stor in tlow, thigh *) tl[coord] := (Box[1.coord] - RayOrigln[coord]) / RayDirction[coord]; t2[coord] := (Box[2,coord] - RayOrigln[coord]) / RayDirction[coord]; tlow := MIN( tl[coord], t2[coord] ); thigh := MAX( tl [coord], t2 [coord] ); (* gt intrsction o f rang so far, and rang [tlow..thigh] *) tmin := MAX( tmin, tlow ); tmax := MIN( tmax, thigh ); ENDIF; ENDFOR; (* now w know th t valu at point o f xit (tmax) so dtrmin th coordinats o f th xit point *) FOR coord := 1 TO Dimnsions DO (* if ray lavs box by th lowr bound on this coordinat *) IF (tl[coord] = tmax) THEN Exit[coord] := tl [coord] - offst; (* if ray lavs box by th uppr bound on this coordinat *) ELSIF (t2 [coord] = tmax) THEN Exit [coord] := t2 [coord] + offst; ELSE (* intrpolat this coord at point o f xit *) Exit [coord] := RayOrigln[coord] + tmax * RayDirction [coord]; ENDIF; ENDFOR; END RayBoxExlt; Figur 2.7.

33 23 In prforming th intrsction tst of th ray with th laf s voxl, Glassnr tsts th ray against all six sids of th voxl. Howvr any givn ray nds to b tstd against only thr sids of th voxl, on pr coordinat. By inspcting th signs of th componnts of th dirction vctor of th ray, it can b dtrmind, for ach coordinat, by which on of th two sids of a box th ray can possibly xit. This is indpndnt of th siz or position of th box, and. is simply a function of th dirction vctor of th ray. This obsrvation may b usd to improv th xit point computation. Although rducing th computation by about half, th basic mthod would still rquir thr divisions, thr subtractions, and thr comparisons for this opration, plus two multiplications and two additions for dtrmining th point of intrsction from th t valu. Ths oprations ar prformd quit frquntly, many tims pr ray, and thrfor th hirarchy travrsal can constitut a major xpns in Glassnr s algorithm Kaplan 1985 In 1985, Michal Kaplan publishd an articl dscribing an implmntion of a bintr which is vry similar to Glassnr s octr [Kapl85]. Th following sctions dscrib this bintr and how it diffrs from Glassnr s octr Kaplan Construction Kaplan uss a mthod vry similar to Glassnr s, diffring mainly in that h uss a bintr to rprsnt th subdivision rathr than an octr. A nod is subdividd at th spatial mdian in ach of th thr coordinats and thr lvls of subnods ar cratd to rprsnt this subdivision. Kaplan dos not stat why h chos th bintr rprsntation of an octr. Howvr, th travrsal algorithm for a bintr is simplr, and a bintr typically rsults in fwr lavs than th corrsponding octr.

34 24 Kaplan builds a bintr which h calls a BSP tr, a trm which h borrows from Fuchs [Fuch80]. Fuchs organizd polygons for visibility procssing by crating a structur which h calld a binary spac partitioning tr. Each intrior nod containd on polygon which was usd to subdivid th polygons in th corrsponding rgion of spac. Kaplan s vrsion of th BSP tr is similar xcpt that his slicing plans ar dtrmind by th position of th nod in th tr and ar major plans, whras Fuchs plans can hav arbitrary normal vctors (and ar usually plans chosn so as to b coplanar to th facs of individual objcts within th scn). Kaplan calls intrior nods slicing nods, and lavs, box nods or trmination nods, dpnding on thir function. A box nod is a standard laf, as prviously dscribd, associatd with a box in th objct spac and possibly containing objcts. A trmination nod is a nod rprsnting spac outsid th objct spac. Raching a trmination nod during travrsal signals that th ray has lft th scn without hitting an objct. Th construction of th tr is govrnd by th sam critria as Glassnr s latr mthod [Glas87c]. A nod is subdividd if it contains mor than a thrshold numbr of objcts, or if it is largr than a thrshold siz. Kaplan suggsts using 1 as th thrshold numbr of objcts. Th problms with this approach ar th sam as thos for Glassnr s mthod. 2.4,2.2. Kaplan Storag Kaplan dos not giv much dtail in his dscription of how his algorithm stors th bintr. Howvr, it appars that h stors th data structur as an xplicit tr, with two pointrs at ach nod indicating th childrn.

35 Kaplan Travrsal Kaplan uss th sam travrsal algorithm as Glassnr. H dos not spcify how h finds a point in th nxt nod, othr than saying that th point of th ray s xit from th box is found and pushd far nough to plac it in th nxt nod ARTS 1986 Fujimoto, Tanaka, and Iwata dscrib what thy considrd a significant spd brakthrough with rgard to spac subdivision structurs for ray tracing [Fuji86]. Although thir octr approach is vry similar to Glassnr s, thir papr includs svral idas worth mntioning ARTS Construction Fujimoto, Tanaka, and Iwata cratd ARTS, which stands for Acclratd Ray Tracing Systm. Th distinction of th ARTS mthod is th spd of its travrsal algorithm, as opposd to th uniqunss of its octr. Th travrsal algorithm uss incrmntal intgr arithmtic to numrat th spac through which a ray travls. It is a thr dimnsional adaptation of th standard two dimnsional DDA (Digital Diffrntial Analyzr) usd to draw lins on bitmaps. This travrsal algorithm can b usd to travrs an octr, or a spcial structur th authors call SEADS, which stands for spatially numratd auxiliary data structur. SEADS rprsnts a uniform spac subdivision, maning that th objct spac is dividd into qual sizd boxs. Th authors claim that th ray-scn intrsction algorithm runs fastr with SEADS than with th octr, but do not giv dtails of th basis of comparison and provid littl justification for this claim. Th papr givs no dtails on th construction of th octr, but thr is rfrnc to both Glassnr s and Kaplan s paprs. Also, th travrsal algorithm rquirs a subdivision algorithm that picks th spatial mdian as th slicing plan for a

36 26 nod. Thrfor, it can b rasonably assumd that thir construction of an octr is quit similar to thos of Glassnr and Kaplan ARTS Storag Th ARTS papr dpicts xplicit storag of th octr as a tr. Two paralll arrays ar usd, whr ach st of ight ntris corrsponds to a singl intrior nod s childrn. For instanc, th first ight ntris in th two arrays corrspond to th ight childrn of th root. On array simply indicats nod status, whthr it is a subdividd nod, mpty laf, or a laf containing objcts. Th othr array contains an indx which is a pointr to a list of objcts if th status indicats this is a laf nod containing objcts, a pointr to th block of ight childrn if th status indicats subdivision, or undfind othrwis. This linkd list mthod of storag is suprior to Glassnr s hash tabl stratgy. Th ARTS mthod rquirs on byt for th status and four byts for th indx, pr nod. Similarly Glassnr rquirs on byt for th subdivision flag and four byts for th objct list pointr. Howvr, Glassnr rquirs an additional four byts (or mor) for id and four byts for a hash tabl link, for ach ight nods, plus spac for th hash tabl of pointrs. In trms of th numbr of nods N in th tr, which is ight tims th numbr of intrior nods, th mmory rquird is HashTablSiz* 4 + -^*(4+4+8* (1+4)) ~ 6*N. 8 Th ARTS mthod rquirs 5 byts pr nod: 5*N, which is about 16 prcnt lss spac than Glassnr s. In addition to bing mor compact, th ARTS mthod has fastr accss than Glassnr s, bcaus of th xplicit links to th childrn stord in th ARTS structur. Indxing is

37 27 usd to find th child of a nod, rathr than computing an indx and sarching a hash tabl as in Glassnr s mthod ARTS Travrsal Th travrsal of th octr is th ky to th spd of th ARTS mthod. Spac is partitiond into small voxls of a fixd siz. Using incrmntal intgr arithmtic, th algorithm dtrmins which of ths voxls that a ray travls through and, using ths, which lavs th ray intrscts. Th siz of th voxls is appropriatly chosn so that th smallst laf nod in th octr is a nonngativ powr of two tims th siz of th small voxls. Th splitting plans of th octr coincid with facs of th small voxls, allowing a straightforward mapping of a small voxl to a laf nod; dtrmination of th laf nod containing a givn voxl can b prformd by inspction of th bits of th indx of th numratd voxl. Whn on of th small voxls is numratd, th laf in which it rsids is found and procssd. Mor voxls ar numratd until a voxl is found outsid th laf, and th nxt laf is found and procssd. Rathr than sarch from th root ach tim a laf is to b found, as Glassnr dos, th ARTS systm travrss upwards from th prvious laf only as far as rquird and thn down to th laf in qustion. Th authors claim this can b don quit fficintly using byproducts of th incrmntal intgr arithmtic algorithm, but do not laborat on how this is don. Th travrsal of an octr is thrfor vry fficint.

38 Chaptr 3 Improvmnts This chaptr outlins a numbr of mthods for improving th fficincy of spac subdivision data structurs, with individual concntration on th construction, storag, and travrsal phass Construction As sn in Chaptr 2, currnt mthods of construction for bintrs and octrs ar quit simpl, providing fast gnration of th data structur. Howvr, th construction of th bintr or octr is typically insignificant compard to th computation spnt in actually travrsing th tr to dtrmin ray-objct intrsctions. Thrfor it would b advantagous to dvot a gratr amount of tim to crating a mor fficint tr, undr th assumption that th xtra tim would thn b savd during th tr travrsal Th Surfac Ara Mtric To dvis such an fficint construction algorithm rquirs som undrstanding of fficincy of bintrs and octrs. Currntly th only rportd fficincy masurs ar from actual us [Glas88] or from simulations [King86]. Such simulations trac a st of rays through a data structur rprsnting a scn of objcts, rcording th spd ithr in trms of actual procssing tim or th numbr of basic oprations rquird. Th lattr is lss implmntation-dpndnt and, thus, is mor rliabl as a gnral masur. Th basic oprations ar usually th total numbr of nods visitd and th numbr of objcts tstd for intrsction. Howvr, such simulations provid no insight into why a particular tr is fficint; it only provids a numrical masur of th fficincy. 28

39 29 A first insight into spac-subdivision fficincy may b drivd from Ston s [Ston75] obsrvation that th numbr of rays likly to intrsct a convx objct is roughly proportional to its surfac ara, assuming that th ray origins and dirctions ar uniformly distributd throughout objct spac, and that all origins ar sufficintly far from th objct. This obsrvation has bn usd to provid a masur of th liklihood that a ray will intrsct a bounding volum in a HE tr [Gold87]. Similarly, w can driv a prdiction of th numbr of objcts, intrior nods, and lavs intrsctd in a givn scn and spac subdivision hirarchy, thrby doing away with th nd for th costly Mont Carlo simulations. Lt us assum that for a givn scn and tr, w ar daling with xactly thos rays that intrsct th bounding volum for th ntir scn, th voxl of th root nod. Thrfor vry ray intrscts th root voxl, and th probability of a ray intrscting th root nod is 1. Th probability of a ray intrscting any intrior or xtrior nod is qual to th surfac ara of th nod dividd by th surfac ara of th root. This rsults in th following intrsction stimations: Ni E S A (i) numbr of intrior nods hit pr ray = SA (root) Nl E «(0 numbr of lavs hit pr ray = ---- SA (root) numbr of objcts tstd for intrsction pr ray = SA (root) Nl

40 30 whr Ni dnots th numbr of intrior nods Nl dnots th numbr of lavs SA (/') dnots th surfac ara of intrior nod i SA(l) dnots th surfac ara of laf nod l N (l) dnots th numbr of objcts stord in laf l Givn ths masurs of th nod, laf, and objct visits prformd during travrsal of th tr, an stimat of th cost of th tr can b obtaind. Th costs associatd with ths thr componnts dpnd on th particular implmntation of th travrsal algorithm and may b dtrmind thortically or xprimntally. Th total cost of a particular tr is dtrmind from th thr sums abov and th thr rlatd costs, which ar assumd to b constants for a givn implmntation. This is xprssd as whr cost of tr = Ni Nl Nl Ci*E SA (0 + C /* SA (0+C o* 5A (l)*n(l) i=l /=1 SA (root) C( = cost of travrsing an intrior nod C[ = cost of travrsing a laf Ca = cost of tsting an objct for intrsction with a ray This cost function assums that rays do not intrsct any objcts, but also rprsnts an uppr bound for rays that intrsct objcts. Th cost function implis that if an objct occurs in two or mor lavs, it is tstd for intrsction ach tim a ray intrscts on of ths lavs. Thrfor a givn objct may b tstd against th sam ray svral tims. As obsrvd in Chaptr 2,

41 31 this is usually unaccptabl, and is avoidd by caching objcts intrsctd against a ray, so that ach objct is tstd at most onc pr ray. Th cost function givn abov must b modifid to account for this caching. To driv th corrct cost function, w rquir a masur of th probability that a ray intrscts at last on laf from th st of lavs within which a particular objct rsids. This is quivalnt to dtrmining th probability that a ray intrscts th volum dfind by th union of th st of lavs. Bcaus this union may b non-convx, th probability of ray intrsction must b stimatd by finding a convx rgion to approximat th non-convx rgion. Figur 3.1 dpicts an objct, th st of lavs containing it, and a convx rgion approximating th non-convx rgion. A simplr approximation is th sum of th aras of th projction of th st onto th six facs of th root bounding volum dividd by th root bounding volum s surfac ara. This is illustratd by Figur 3.2 which dpicts th sam objct as Figur 3.1 but includs th root bounding volum and th projction of th st of lavs onto this bounding volum. For a convx objct, this masur is xactly qual to its surfac ara dividd by th root bounding volum s surfac ara, which is th corrct masur. Thrfor, w can us this approximation for th st of lavs for all objcts, whthr th st of lavs for ach objct is convx or not. This maks th objct portion of th

42 32 Figur 3.2. cost of a tr: objct cost pr ray = C0*ESAi«(S,(o)) 0= 1 SA (root) whr N0 is th numbr of objcts Si(o) is th st of lavs in which th objct o rsids SAst(s) dnots th approximat surfac ara of th st s If w assum that th abov costs ar accurat, w can us ths quations to govrn th construction of th tr.

43 33 Considr th octr mthods of Glassnr or ARTS, which subdivid nods in a bradth-first fashion. As th tr is built up from a tr of just on nod, th abov quations can b usd to calculat th ovrall dcras in cost cratd by subdividing a particular nod. This calculation involvs computation of th surfac ara of th nod, th surfac aras of its childrn, and th numbr of objcts blonging in ach child, if it wr to b cratd. Th calculation is quit simpl bcaus ach child of a nod has xactly on quartr of th surfac ara of its parnt. A rasonabl huristic would b to subdivid whichvr nod would dcras th cost of th tr most, rathr than using a bradth-first slction mchanism. A bound on th siz of th tr would still b rquird to control th amount of spac usd. Such a huristic would prform th subdivision whr it is ndd most, that is, whr th most gain would b achivd, as opposd to a bradth-first mthod which is somwhat mor random in its choic of a nod to split. This mthod ffctivly prforms a on-stp lookahad to dtrmin th cost of splitting a particular nod. Th xpns of this stp may b liminatd by using th currnt cost of a particular nod as its stimatd gain and changing th subdivision procss to slct th nod which has th highst cost. Th rsults of this zro-stp lookahad can b xpctd to b similar to th highst-gain mthod, bcaus in gnral, th highr th cost of a nod, th highr th gain by subdividing it. Howvr, th zro-stp lookahad is computationally chapr. Th cost function can b usd not only to slct th nod splitting as dscribd abov, but also to slct th position of th splitting plan within a nod. Traditionally, this has bn th spatial mdian, with on xcption bing Hckbrt s mdian split algorithm [Hck82]. Hckbrt chooss th objct mdian in a k-d tr whr th objcts ar colour triplts (points). Unlik th othr mthods dscribd, which ar applid to ray tracing, Hckbrt uss th spac subdivision structur to slct a st of colours to b usd in a lookup tabl to approximat a largr st of colours, which ar th data bing

44 34 organizd. On obvious rason why th spatial mdian is usually chosn as th splitting plan is that it dos not rquir storag of th position of th splitting plan. Anothr rason may b that no on has suggstd a good algorithm for slcting splitting plans. Th cost quation dvlopd abov can also b applid to slcting good splitting plans, whr th splitting plans ar not rstrictd to bing th spatial mdian. Th xtra dgr of frdom grantd by allowing splitting plans to b anywhr within a box may provid a mor fficint tr and may mak up for th addd mmory rquirmnts of this splitting plan slction. In th following discussions of splitting plans, w will, for simplicity, only considr th bintr, sinc it uss only on splitting plan pr nod. Only major plans ar usd as splitting plans and w ignor, for now, th possibility that an objct may blong in mor than on nod. Lt us look at th subdivision along a particular axis c whn w hav to choos a valu for som paramtr b, whr b = 0 corrsponds to th lowr bound of th coordinat c of th box and b = 1 is th uppr bound. Choosing b = 0.5 is quivalnt to slcting th spatial mdian (Figur 3.3). Lt us look at th cost savings as a function of this paramtr b. W obsrv that th intrnal nod and laf nod componnts of this cost savings function ar constant with rspct to b. Thrfor, for th purposs of minimizing cost, on can minimiz th following function: f ( b ) = LSA (Jb)*L(b) + RSA(b)*(n-L(b)) - SA*n whr n is th numbr of objcts in th nod, L(b) is th numbr of objcts to th lft of th plan at b, and n L(b) is th numbr to th right. Th surfac ara of th lft and right subnods ar LSA(b) and RSA(b), rspctivly, and th surfac ara of th nod itslf is SA. Th first trm rprsnts th probability that a ray intrscts th lft subnod multiplid by th numbr of

45 35 intrsction tsts prformd in th lft subnod. Th scond trm is a similar quantity for th right subnod. Th "SA*n" trm is th amount of work rquird if th nod wr not subdividd and thus is an amount of work savd by changing th original nod from a laf to an intrnal nod, hnc th minus sign. This last quantity is a constant with rspct to b, so it may b rmovd from th function, rsulting in: f(b ) = LSA (b)*l (b) + RSA (b)* (n L (b)) To find a good splitting plan, on might valuat this function at svral diffrnt positions, and choos th position with th minimum valu. Howvr, lt us xamin th bhaviour of this function. Th valu of this function at th spatial mdian ( 7=0.5) is n*lsa (0.5), bcaus LSA (0.5) = RSA (0.5). Curiously nough, th valu of this quation at th objct mdian, whr half of th objcts ar on ach sid of th slicing

46 36 plan, (L(b)=^~), is also (LSA (b)+rsa (b))*^- = n*lsa (0.5) bcaus LSA(b)+RSA(b) is a constant, LSA(0.5) = RSA(0.5), thrfor LSA(b)+RSA(b) may b substitutd by 2*LSA(0.5). This shows that picking th objct mdian rsults in th sam gain as picking th spatial mdian. Intuitivly, on might assum that picking th objct mdian would b a rasonabl huristic for choosing an arbitrary splitting plan, but th abov obsrvation indicats that it is quivalnt to th standard spatial mdian subdivision. Th optimum huristic is to pick th slicing plan which minimizs f(b ). Diffrntiating with rspct to b givs f'( b ) = LSA (b)*l(b) + LSA(b)*L'(b)+ n*rsa'(b) - RSA '(b)*l(b) RSA (b)*l'(b) which can b simplifid by substituting LSA'(b) for RSA'(b) (bcaus LSA(b) + RSA(b) is a constant), giving, f'( b ) = (2*L(b)-n)*LSA'(b) + (LSA(b) - RSA(b))*L'(b) Sinc L(b) is a discontinuous function, L'(b) is not dfind. Howvr, for th purposs of minimization of /(b ), w can assum that L '(b) is always nonngativ (th numbr of objcts stord in th lft subnod cannot dcras as b incrass). Lt us try to narrow down th rang in which th minimum might li. Lt us invstigat th cas whr th objct mdian lis at som point ><0.5. To th lft of th objct mdian, /'( b ) is ngativ, bcaus L(b)< ^- and LSA(b)<RSA(b). To th right of th spatial mdian, /'( b ) is positiv, bcaus L(b)> y and LSA(b)>RSA(b). Thrfor th minimum must occur btwn th objct mdian and th spatial mdian in th cas

47 37 whr th objct mdian is to th lft of th spatial mdian. A similar proof can b usd for th othr cas whr th objct mdian is to th right of th spatial mdian, thrby proving that for any nod and st of objcts within it, th optimum slicing plan occurs btwn th objct mdian and th spatial mdian, rducing th rquird sarch rang. Figur 3.4 rprsnts a st of 10 objcts within a singl nod in two dimnsions, th spatial and objct mdians, and th narrowd rang of sarch for th optimum splitting plan. objct spatial mdian mdian Th optimum splitting plan occurs within th rducd rang, and at th uppr or lowr dg of on of th objcts within this rang, rathr than in th middl of whit spac. To tak advantag of this rducd rang, on must first find th objct mdian, which is asy if th objcts ar sortd, but othrwis rquirs a binary or Fibonacci sarch of th spac. If on dos not want to prform this sarch, on can dtrmin how many objcts ar on ach sid of th spatial mdian, thrby dtrmining on which sid of th spatial mdian th objct mdian occurs. This allows on to cut th sarch spac in half. In th cass of small numbrs of objcts, on can try splitting plans at

48 38 th limits of ach objct within th appropriat half and rcord th maximum. For larg numbrs of objcts, on might try a small st of splitting plans, at qually spacd intrvals, or vn randomly slctd, within th appropriat half. Altrnativly, a chap huristic is to slct th splitting plan midway btwn th objct mdian and th spatial mdian Objcts Spanning th Slicing Plan If w rlax our rstriction about daling only with cass whr objcts blong in xactly on laf, th quation gts slightly mor complicatd. Th incrasd cost function is now f ( b ) = LSA (b)*l(b) + RSA(b)*R(b) + S A * (n -L (b )-R (b )) - n*sa (which can b rducd to b*r(b) ( l b)*l(b)). L(b) rprsnts th numbr of objcts that blong in th lft subnod but not in th right, R{b) rprsnts th numbr of objcts that blong in th right subnod but not th lft, and n L(b) R(b) is th numbr of objcts that blong in both subnods, so calld spanning objcts. Th first two trms in th abov quation rprsnt an stimat of th numbr of nonspanning objcts tstd for intrsction du to th lft and right subnods. Th third trm rprsnts th numbr of spanning objcts tstd, assuming that th algorithm uss an objct cach to avoid multipl intrsction tsts with th sam objct. Not that w approximat th probability that spanning objcts ar tstd for intrsction by th surfac ara of th original nod, bcaus a ray that intrscts this nod causs ray-objct tsts with th spanning objcts indpndnt of which subnods ar intrsctd. As bfor th trm n*sa rprsnts th cost of th undividd nod. Th rducd sarch spac may b usd if thr ar no spanning objcts at th spatial mdian and an objct mdian with no spanning objcts can b found. Othrwis, on may apply th simpl mthod of sampling th function

49 39 valu at various positions to dtrmin a minimum. Th minimum position may not b asy to find using numrical tchniqus, bcaus th scond drivativ is not ncssarily ngativ, causing th function to b nonmonotonic on ithr sid of th minimum. This can happn whn two objcts ovrlap along th axis of th appropriat coordinat. Howvr, if thr is no such ovrlap, thn th st of plans at th uppr and lowr limits of ach of th objcts contain th optimal plan, and th cost function is monotonic dcrasing bfor th optimal plan, and monotonic incrasing aftr. A binary or Fibonacci sarch can thn b prformd to dtrmin th optimal splitting plan. In a bintr approach, it is ncssary to dtrmin th optimum axis of subdivision as wll as th optimum splitting plan for this axis. Th abov algorithm can b usd to slct th optimum slicing plan and gain for ach of th axs. Th axis with th maximum gain is chosn as th axis of subdivision for this nod. For an octr, th problm of slcting th thr optimum slicing plans is mor complicatd, bcaus of th nd to dal with thr axs at onc. On solution is to apply th abov algorithm to ach axis indpndntly to slct a good slicing plan for ach axis. W hav now sn how a good splitting plan may b slctd, and how to choos th nxt nod for subdivision. This lads to an ovrall algorithm for construction of a bintr or octr with arbitrary slicing plans Optimal Trs It is worthwhil invstigating optimal spac subdivision trs, but it is first ncssary to dfin optimality. A tr may b optimal with rspct to spac or tim (sarch cost), or a combination of both. Th tr that is optimal in trms of spac for a givn scn is a tr of on laf containing all th objcts in th scn, clarly an impractical critria for optimality. Likwis, th tr that is optimal with rspct to tim may rquir impractical amounts of

50 40 storag. Thrfor th dfinition of optimality should combin th spac and tim factors. On might dfin optimality as th most compact tr that provids th dsird qury tim, or as th most fficint tr for a givn amount of spac, which is th dfinition usd in th following discussion Spatial Mdian Subdivision of Point Objcts Lt us invstigat th optimal spatial mdian subdividd octr, dfind as th most fficint tr for a givn siz. Th siz of an octr is dfind as th numbr of intrior nods. Lt us rstrict th objcts to non-coincidnt uniformly distributd random points. This choic of objct typ guarants that ach objct blongs in xactly on laf. Subdividing a nod rsults in a prdictabl gain, assuming th rlativ costs of visiting lavs and intrnal nods, and of intrsction tsts ar givn. For instanc, th dcras in th numbr of intrsction tsts du to splitting a nod into ight subnods is 3 *SA{nod)* ^objcts in nod. Th algorithm for producing an optimal octr starts with a singl laf nclosing th ntir scn and rptitivly splits whichvr nod rsults in th highst gain until th numbr of intrior nods is qual to th dsird numbr. This algorithm rlis on th obsrvation that optimal trs ar built up from smallr optimal trs. Mor formally, for any optimal octr of siz n and for any m gratr than n thr must b an optimal octr of siz m which contains th smallr optimal octr as a subtr. This can b provd by ralizing from th prvious formulas that th gain in subdividing a child of a nod must b lss than or qual to th gain in subdividing th nod itslf. This obsrvation is usd in an inductiv proof. Clarly th optimal octr of siz 1 is th laf tightly nclosing th scn, which must b a subtr of all optimal octrs of siz gratr than 1. If an optimal octr of siz n+ l dos not hav a givn optimal octr of siz n as a subtr, thr must b a

51 41 subdividd nod in th siz n optimal octr which is a laf L in th siz n+1 optimal octr. By virtu of th gratst-gain subdivision procss, thr must b som nod N in th siz n+1 optimal octr whos childrn ar lavs, such that th gain du to th subdivision of N is lss than or qual to th gain which rsults from subdividing th laf L. Thrfor, within th largr optimal octr, th nod N can b rplacd by a laf, and its formr childrn usd to split th laf L, rsulting in a nonngativ ovrall dcras in th cost of th octr. This rarrangmnt of th nods within th siz n+1 optimal octr rsults in a nw octr which is still of siz n+1, and is at most as costly as th original, and hnc is still a siz n+1 optimal octr. This procss of moving nods can b rpatd until w hav an optimal octr of siz n+1 which has th givn siz n optimal octr as a subtr. As a largr optimal octr is built up from smallr ons, th algorithm vntually sparats all points such that vry laf has xactly on or zro points within it. Aftr this, th algorithm rptitivly subdivids th largst laf which has an objct in it, bcaus th numbr of objcts in all such lavs is qual. Evntually all th non-mpty lavs ar on th sam lvl, and th algorithm ffctivly prforms th sam bradth first subdivision procss that rsults from Glassnr s or th ARTS mthod with th objct thrshold st to zro (subdivid if gratr than zro objcts in th nod). For octrs that hav rachd this stag, th stimatd objct intrsction tsts is qual to th numbr of objcts * numbr of ray- \i 3 1 whr / is 4 th numbr of lvls in th octr, with a siz 1 octr corrsponding to /=0. Othr charactristics of th octr can b stimatd also. Lt n b th numbr of random point objcts in th scn, and h b th hight of an optimal octr rprsnting th scn (h= 0 corrsponds to a 1-nod octr). W assum that th optimal octr is sufficintly larg that ach laf has

52 42 xactly on or zro objcts stord in it, and vry laf with an objct within it is at lvl h. Bfor driving stimats for optimal octrs, w first dvis som masurs for complt octrs of arbitrary hight Z, also assuming spatial mdian subdivision. At lvl /, th numbr of lavs is 8*. Th numbr of occupid lavs 0(1) is: min(8l,n). 0(1) = i*p(i, s', n) i=l whr P(i,p,n) is th probability that th n randomly distributd points rsult in xactly i occupid lavs givn that th total numbr of lavs is p. This is computd as: P(it p, n) = P(i 1, p, n 1 ) * P(i, p, n 1)* P 'in-l P whr P(i, p, n) is 0 if n<i, and P(l, p, n) is W can now us th formula for th numbr of occupid lavs in a complt octr to comput som statistics for th optimal octr of hight h. Th numbr of mpty lavs at lvl l in th optimal octr is qual to th total numbr of lavs in th corrsponding complt tr (8*) minus two quantitis. Th first quantity is th numbr of lavs that ar subdividd and hnc ar not mpty lavs at lvl /. This is th numbr of non-mpty lavs in th corrsponding complt tr at lvl /, which is 0(1). Th scond quantity rprsnts th numbr of lavs at lvl l which ar missinig bcaus on of thir ancstors is a laf. This is th sum of th numbr of mpty lavs at ach lvl lss than / wightd by th numbr of lvl / lavs ths largr lavs rprsnt. Th rsulting formula for (/), th numbr of mpty lavs at lvl / in th optimal octr is:

53 43 E(l) = 81-0(1) - 8/-,'*E(i) /=/ l Th numbr of occupid lavs in th optimal octr is n, bcaus all lavs contain xactly zro or on objcts. 1(1), th numbr of intrior nods at lvl Z in th optimal octr, is th numbr of occupid lavs in th corrsponding complt octr. Using ths stimats th following statistics rgarding th siz and prformanc of th optimal spatial mdian octr of hight h can b stimatd: Siz of Tr: h-1 numbr of intrior nods in octr = X) 0(1) /-0 /? 1 min(8l, n). = E E n) 1=0 1=1 h numbr of mpty lavs in octr = XI (0 /=0 h - E /=0 8/ - 0(1) - /=/-! numbr of non-mpty lavs in octr = n

54 44 Prformanc of Tr: stimatd intrior nod visits stimatd occupid laf visits stimatd mpty laf visits stimatd objct tsts h- 1 = E /-0 h-1 = s 1=0 \ / *0(1) = \l 4 V / ( i_ 4 V / h = /=0 4 V / = n* 4 \ J (/) minis1, n) * > /> ( (, 8 ', n) 1=1 W now hav an algorithm to produc th optimal spatial mdian octr for a givn siz, and w also hav an stimat of th numbr of fundamntal oprations prformd. Using ths quations and stimatd costs of visiting intrior nods, laf nods, and objcts, th siz which rsults in th most fficint octr can b dtrmind Arbitrary Subdivision of Point Objcts If w assum that w hav point objcts and w rmov th rstriction of spatial mdian subdivision, thr is no similar algorithm for th construction of an optimal octr. Th problm is that th optimal slicing plan must b found for ach nod. Th algorithm givn prviously for slcting th slicing plan position rsults in th optimal slicing plan assuming that th childrn ar not subdividd. Thr is no guarant that this is th optimal slicing plan if th nod has grandchildrn.

55 45 Howvr, on can stimat th fficincy of th optimal octr without knowing how to construct it. Bcaus th slicing plans can b arbitrarily positiond, th lavs can tightly nclos th objcts, which ar points. Thrfor th stimatd numbr of objcts tstd for intrsction is zro. Sinc th positions of th slicing plans within a nod do not affct th sum of th ight nw childrn s surfac aras, it can b stimatd that th numbr of intrior nods and lavs intrsctd is roughly quivalnt to that of th corrsponding optimal spatial mdian octr. Evn for non-point objcts, th numbr of objcts tstd for intrsction can b xpctd to b significantly lss for th optimal arbitrary tr du to th ability to provid laf nods that tightly nclos th objcts. Bcaus th ray-objct intrsction tst is typically th most xpnsiv opration, th optimal arbitrary octr is probably significantly fastr than th corrsponding spatial mdian octr. This provids a motivation for arbitrary subdivision instad of spatial mdian subdivision, vn if an optimal algorithm cannot b dvisd Evaluation of Convntional Octr Construction Mthod If w assum that objcts do not intrsct ach othr and that ach laf has at most on objct, th stimatd cost of th optimal octr can b usd to masur th prformanc of Glassnr s or th ARTS algorithm. Howvr, ths assumptions ar not valid in practic, bcaus objcts oftn ovrlap and ar so clos to othr objcts that lavs may hav many objcts stord within thm. Hnc thr is no obvious stimat of th fficincy of Glassnr s construction mthod. Th surfac ara mtrics can b usd to illustrat a dficincy with Glassnr s mthod. This dficincy ariss from th us of a valu gratr than zro as th objct thrshold. This mans that only a nod which has mor than th thrshold numbr of objcts is subdividd. A nod which has only on objct in it, for xampl, is not subdividd furthr. Considr Figur

56 Evry ray that intrscts th lft subnod is tstd for intrsction with th objct within it. Bcaus th cost of a laf visit is lss than th cost of an objct tst, it is mor advantagous to subdivid this nod, rducing th liklihood that a ray is tstd against this objct. This dficincy can b rmdid somwhat by stting th objct thrshold to zro, which causs th algorithm to subdivid vry non-mpty nod. Howvr, additional travrsal cost is introducd Arbitrarily Orintd Splitting Plans In 1986, Kay and Kajiya [KayK86] showd how to us prcomputation to rmov th dot product calculation from th intrsction tst of a ray with an arbitrarily orintd plan. Th computation of th paramtr t of a ray was givn in Chaptr 2 as: _ d NO l~ N D For a givn ray, N O and N D can b prcomputd for a st of plan normals. Thn ach intrsction of th ray with a plan having on of ths normals rquirs only on subtraction and on division, th sam as th quation for major plans. Bcaus multiplication is fastr than division on many

57 47 machins, divisions ar oftn liminatd by prcomputing a rciprocal to b usd in multiplication. For our discussion, w assum that division is quivalnt to multiplication, bcaus it can b implmntd as such. Our discussion of slicing plans so far has bn limitd to major plans, but Kay and Kajiya s papr indicats that it is possibl to us a st of arbitrarily orintd splitting plans at littl xtra cost. Th surfac ara mtrics can b applid to arbitrary plans to dtrmin th optimum orintation, as wll as position, of a splitting plan. Th xtra dgr of frdom gaind by allowing arbitrary orintations may rsult in a mor fficint tr, bcaus th surfac aras of th voxls containing objcts can b minimizd furthr. Th convntional travrsal algorithms usd by Glassnr and Kaplan would not work without modification, bcaus of th ncssity of finding a point strictly within th nxt laf, as opposd to on or within th nxt laf. Bcaus th sids of a voxl ar no longr orthogonal to ach othr, on cannot simply push th ray xit point prpndicular to th xit plan bcaus thr is no guarant that it is within th nxt laf. Th xact ray xit point must b usd, rquiring a travrsal algorithm which handls this ambiguous point (blonging in two or mor lavs) and avoids an infinit loop of procssing du to a cycl in th list of numratd lavs. Th algorithms of Glassnr, Kaplan, and Fujimoto t al. cannot b usd without modification to chck for cycls. Th basic rcursiv travrsal algorithm givn in Chaptr 2 can b usd without modification Scn Complxity and Efficincy Thr ar many rfrncs in th litratur to scn complxity, which usually tak th form of qualitativ statmnts about th amount of work rquird to rndr a scn, or th amount of visual dtail of th imag. Typically, on talks about visual complxity and computational complxity. Visual complxity typically dals with issus such as how many pixls compos

58 48 th imag and how thy vary in colour and position, whil computational complxity dals with how much work is rquird to rndr th imag. Th surfac ara ida is now xtndd to provid masurs of ths two complxitis. W can dfin th visual complxity of a givn scn as th probability that a ray that striks th bounding volum of th scn striks an objct within th scn. Th surfac ara of ach objct in th scn can b usd as stimat of th liklihood of it bing intrsctd by a ray. Altrnativly, on might us th objct bounding volums surfac aras instad of th objcts thmslvs, for simplicity. Th numrical masur of th visual complxity is th surfac ara masurmnt of th st of all bounding volums, using th SAst function dfind prviously, dividd by th surfac ara of th scn bounding volum. As dscribd prviously, this is calculatd by projcting all bounding volums onto ach of th six facs of th scn bounding volum, and dividing th ara of th union of ths projctions by th surfac ara of th scn bounding volum. A valu nar 1 mans that th majority of rays ntring th scn hit an objct and almost all pixls in th imag ar hit. A valu nar 0 indicats that fw rays hit objcts and thus that th imag is narly mpty. This masur is approximatly qual to th fraction of pixls that hav colour in th final imag, indpndnt of th rndring algorithm, which maks it usful as a gnral-purpos visual complxity masur. On may also us this visual complxity masur as a basis of comparison for a rndring fficincy masur. It is rasonabl to xpct that, idally, th amount of work prformd in rndring should b proportional to th visual complxity. In th cas of ray tracing, optimal prformanc occurs whn th numbr of intrsction tsts for ach ray is zro or on, dpnding on whthr it hits an objct or not. By dividing th numbr of ray-objct tsts pr ray by th visual complxity, on may gt a masur of fficincy, whr a valu of on rprsnts optimal fficincy.

59 49 Th optimal cas is usually not attainabl, and it is mor dsirabl to hav a gnral purpos computational complxity masur. Computational complxity can b dfind as th amount of work involvd in rndring th imag and approximatd as th avrag numbr of objcts that map to a pixl. A justification of this as a rndring algorithm-indpndnt masur is providd by th obsrvation that th amount of work in ray tracing, for xampl, is mor rlatd to th numbr of objcts th avrag ray gos nar than to th numbr of rays that hit objcts. In othr rndring algorithms, such as z-buffring, th work rquird is proportional to th avrag numbr of objcts that map to a pixl. On stimat of this computation might b th sum of th objct surfac aras (or bounding volums) dividd by th scn bounding volum surfac ara. Th computational complxity, bing a sum of surfac aras, is gratr than or qual to th visual complxity, which is in a sns a union of th sam surfac aras. Computational complxity provids a masur of th avrag amount of work rquird to rndr a scn, as opposd to th minimum amount rquird, which is providd by th visual complxity Load Balancing in Multiprocssor Algorithms Anothr application of th surfac ara mtric is in load balancing of multiprocssor algorithms. Static load balancing of an objct spac algorithm attmpts to subdivid spac so that ach procssor prforms an qual amount of work. Th surfac ara of a bounding volum tims th numbr of objcts within it provids a good stimat of workload for static load balancing. A similar ida may b usd for dynamic load balancing of objct spac multiprocssor algorithms.

60 Storag Th simplst and most obvious mthod of storing th bintr (octr) is as an xplicit tr with two (ight) pointrs pr nod. This has a larg spac rquirmnt, motivating th mor compact octr schms of Glassnr [Glas84] and Fujimoto t al. [Fuji86]. It was dmonstratd in Chaptr 2 that Fujimoto s linkd list mthod was suprior to Glassnr s hash tabl mthod. On dficincy with Glassnr s mthod is th nd to prform multiplications and divisions to construct a nod idntifir, du to th bas 10 natur of th idntifir. A bttr ncoding of laf idntifirs is to us thr bits pr lvl to indicat th position of th laf, plus four bits to stor th lvl of th laf. Thus a 32-bit idntifir can rprsnt lavs in a tr which has up to nin lvls of subdivision. This typ of idntifir can b manipulatd with fast bit oprations, an improvmnt ovr Glassnr s mthod. Th particular storag mthod for a tr has a markd ffct on th spd of travrsing th tr. Travrsal of th tr is mainly movmnt from on laf to anothr. Th tr should b stord in such a mannr as to minimiz th computation involvd in dtrmining th nxt laf intrsctd. This travrsal cost can b dcrasd by storing links to nighbours on ach of th six facs of ach laf. Samt [Sam84] dscribs similar links in rgion quadtrs, which ar trmd rops. For th purposs of th following discussion, lt ach fac of ach laf hav xactly on nighbour, dfind as th smallst nod (intrior or laf) whos voxl s surfac totally ncloss th fac of th laf in qustion. By this dfinition, th nighbours of a laf ar not ncssarily lavs. Howvr, this dfinition guarants that ach laf has xactly on nighbour pr fac (xcpt lavs on th boundary of th scn, which hav non). Figur 3.6 illustrats th nighbours of four lavs. During travrsal of th structur it is now ncssary to dtrmin th fac xitd. Th nighbour link of this fac is followd and if th nighbour of th fac is a laf, procssing of th objcts within th laf is prformd. If th

61 51 currnt laf sam siz laf Figur 3.6 Th nod to th right of th laf is th lafs nighbour for th righthand fac. nighbour is an intrior nod, thn th xit point of th currnt laf must b computd and usd to dscnd th nighbour s subtr to find th appropriat laf. This stratgy liminats all upward travrsal of th tr and som downward travrsal. In gnral, whn a ray travls from on ara to an ara of qual or lss fin subdivision, thn th nighbour is a laf and th hirarchy travrsal cost is zro. It is only whn travlling to an ara of highr subdivision that thr is any hirarchy cost. In this cas th cost is lss than th corrsponding cost of convntional mthods, bcaus th upward travrsal to

62 52 th common ancstor is liminatd, and som of th downward travrsal may b avoidd (about qual to th upward travrsal liminatd). Thrfor, th nighbour links rduc th hirarchy cost significantly, at th addd xpns of six pointrs pr laf. A furthr modification of th nighbour links is to rdfin th nighbours of a fac as all lavs adjacnt to that fac. Now, all nighbours ar lavs, but any givn fac may hav mor than on nighbour, which rquirs mor mmory pr laf than th prvious link stratgy. Howvr, in th cas of spatial mdian subdivision, th amount of mmory rquird is now lss than 12 pointrs pr laf, only twic that of th formr links mthod. Th uppr bound of 12 pointrs pr laf stms from th obsrvation that, although som facs hav a larg numbr of nighbours, othrs hav only on nighbour, with th avrag bing two pointrs pr fac. This is illustratd in Fig- 2* n ur 3.7, which shows n + l facs, and 2*n links, and hnc links pr n+1 laf, which is lss than two pointrs pr fac. With arbitrary subdivision, th numbr of pointrs pr fac may b highr, bcaus Figur 3.7 no longr covrs all possibl subdivision cass. Th storag of th nighbours for a laf consists of six intgrs rprsnting th numbr of nighbours of ach fac, plus a list of pointrs to th nighbours of ach fac. Altrnativly, th nighbours could b stord in a two dimnsional bintr to quickly dtrmin th appropriat nighbour for a givn xit point. This complt nighbour links schm liminats th hirarchical travrsal altogthr, bcaus finding th nxt nod only rquirs following th links. It introducs th additional cost of dtrmining which link to follow, if a laf has mor than on nighbour on a givn fac. If a fac has n nighbours, on avrag y of thm hav to b tstd (four ral comparisons pr tst) to find th on intrsctd by th ray, assuming a linar sarch. If w assum that

63 53 1 laf n lavs Figur 3.7 n + 1 lavs, 2n links. 2n links th numbr of nighbours of a laf is proportional to its surfac ara (bcaus nighbours shar a common surfac), thn th stimatd numbr of such tsts pr ray is proportional to Nl Nl E sa(l)*sa(l) ~ s a il) 2. 1=1 1=1 With a roughly uniform subdivision, th volum of ach laf is -, Nl is th numbr of lavs. Th surfac ara of a laf is proportional powr of th volum, so th numbr of tsts pr ray is proportional to whr Nl 2 to th 3

64 54 Nl E i l ' f \ 2 ' 3 N l K Nl ~ S m V)v7 This provids th indication that incrasd subdivision lads to a dcrasd amount of work pr ray for dtrmining which nighbours to follow. In rough trms, ach additional complt lvl addd to an octr rsults in ight tims as many lavs but half as much work for dtrmining nighbours. Bttr sarch prformanc may rsult by using a two dimnsional bintr to sarch for th nighbours, or by prforming a binary sarch on th sortd nighbour lists. Eithr of ths two mthods rducs th xpctd numbr of tsts pr fac to logn complxity. Also, th form of th tsts is singl comparisons in th cas of th two dimnsional bintr, rathr than four comparisons. Th xpctd numbr of comparisons is thrfor proportional to Nl f]sa(l)\ogsa(l) /= 1 Nl i ~ *-r-*lognl /-l 2 4 N l3 ~ 3\^v7*iog/w Although it appars that th nighbour links approach may hav larg spac rquirmnts, thr is a mmory-spd tradoff. Instad of dfining links to occur at all lavs, on can dfin th links to occur at all intrior nods that only hav lavs for childrn. This dcrass th xtra spac to approximatly on ighth of th original spac rquirmnts in th octr

65 55 cas, or on half in th cas of a bintr. This mthod incurs th sam travrsal cost as th original nighbour links plus on additional upward travrsal pr laf and possibly som xtra downward travrsal. Altrnativly, th linking is dfind to link th st of nods at a particular hight abov th lavs. For xampl, links may b stord in all nods which ar a fixd distanc n abov th dpst laf in thir subtr. Th cas n = 1 corrsponds to th abov mthod of storing at all nods that only hav lavs for childrn. 1 " Th amount of mmory rquird is proportional to ( ) in th cas of an 8 octr, yt th xtra travrsal cost is only proportional to n. A suitabl valu of n rsults in an appropriat tradoff btwn spac and th additional up and down travrsals. For practical cass n can b quit small Multiprocssor Implmntation Th complt nighbour links stratgy is wll suitd to implmntation on a multiprocssor systm. Each procssor can rprsnt lavs, prforming th ray-objct intrsction tsts, and alrting th appropriat nighbour if th ray passs through without intrscting an objct. Altrnativly, a sparat st of procssors may b usd to prform th nighbour computations Storag of Voxl Dimnsions Anothr issu is whthr th voxl dimnsions ar stord in ach laf nod. In ordr to numrat th nxt laf intrsctd by a ray, th limits of th currnt laf voxl ar usually rquird. Th storag rquird for ach voxl is six floating point numbrs, which may b a significant cost. Glassnr, Kaplan, and Fujimoto t al. hav similar suggstions for avoiding this cost. Th limits of ach ncountrd voxl ar computd by maintaining th limits of ach intrior nod ncountrd, using th splitting plans of th parnt to dtrmin th limits of th childrn. In addition, with spatial mdian subdivision, th valu of th splitting plan dos not nd to b stord

66 56 in ach intrior nod, as it may b computd as th midpoint of th limits of th nod s box. Th computational implications of ths schms ar that a stack of voxl limits must b rcursivly maintaind and updatd for ach movmnt from parnt to child. Anothr possibl solution that avoids storing voxl limits prforms som vrtical travrsal to comput th voxl for a givn laf. By following th path back through ancstors and xamining splitting plans, th limits of a laf voxl may b rconstructd. In two-thirds of th cass, it taks at most thr upward travrsals. With convntional travrsal algorithms, th additional computation involvd in ths spac-tim tradoffs may b accptabl, bcaus thy do not introduc additional travrsals through th tr. Howvr, th nighbour links travrsal algorithm attmpts to spd up laf numration by liminating travrsal of th intrior nods of th tr, so introducing th additional cost of maintaining th voxl limits in th convntional rcursiv way would dfat th purpos of th links. On obvious solution is to stor th limits in ach laf. Th additional spac is six rals pr laf, which sms a significant amount. Howvr, with th complt nighbour links stratgy, th intrnal nods ar only rquird for finding th initial laf for ach ray. This mans that th intrnal nods can b liminatd and altrnativ stratgis usd to find th initial laf. For xampl, for rays that originat outsid th scn, th first laf can b found by using quadtrs on ach of th six facs of th root bounding volum. For rays that originat within th scn, th ray can b xtndd to th dg of th root bounding volum, and lavs numratd until th laf containing th origin is found. This opration nd only b prformd for a small numbr of points, i.., th y point in most ray tracrs, if th laf containing th point of intrsction is rcordd whn tracing a ray. Th origin of all rays in a ray tracr is almost invariably ithr th y or a point of intrsction of a prvious ray with th scn, for which th corrsponding

67 57 lavs is rcordd from th prvious sarch. In a bintr rprsntation, th numbr of intrnal nods is qual to th numbr of lavs minus on. Dpnding on th implmntation, ach intrnal nod may rquir up to two pointrs for childrn, possibly a parnt pointr, on ntry for ach splitting plan and/or splitting coordinat. Th xtra mmory rquird by storing th voxl limits in lavs ar thrfor in th ordr of that savd by th limination of intrior nods. If w ar using a spatial mdian stratgy with an octr, a storag schm which capitalizs on th fact that th sizs of th voxls ar powrs of two is availabl. On may us th idntifir ncoding schm prviously mntiond, which stors a nod idntifir in 32 bits. Th limits of th voxl can b implicitly gnratd from this 32 bit idntifir, bcaus th lvl indicats th siz, and th position information can b usd to dtrmin on cornr of th voxl. Th additional storag of this mthod is four byts pr laf, unlss w ar using a hashing schm, in which cas th idntifir is alrady rquird for th hashing and th additional cost is zro. This stratgy can b usd with ithr th convntional travrsal algorithm or th nighbour links mthod Storag of Objct Lists Storag of th lists of objcts that blong in ach laf hav larg spac rquirmnts. Glassnr stors all th objct lists in a singl array of objct indics, whr ach list nds with a NIL indx (Figur 3.8). Glassnr s schm provids a sparat objct list for ach laf. A mor compact schm would allow mor than on laf to point to th sam objct list. In cass whr thr ar many duplicat laf lists, this schm would rsult in significant mmory savings. Thr would b an additional cost during th travrsal phas in ordr to idntify duplicat lists. Additional savings may rsult if lists which ar substs of othr lists ar idntifid, and a pointr

68 58 Figur 3.8 G lassnr O bjct List Storag. to th bginning of a sublist within a largr list usd to avoid xplicit storag of th sublist. Th largr list would hav to b organizd so that th sublist is at th nd. Anothr compact schm is to partition th st of objcts into quivalnc classs, whr ach quivalnc class is a st of objcts which blong in th sam st of lavs. In th wors cas, ach quivalnc class consists of on objct, in which cas this schm is quivalnt to th abov many-to-on linking. Th objct list for a laf is now a list of quivalnc classs, rathr than a list of objct indics. Figur 3.9 dpicts this data structur, which not only

69 59 allows a many-to-on mapping of lavs to an intrmdiat lvl of objct list, but also a many-to-on mapping of this intrmdiat objct list to th quivalnc classs. Figur 3.9 E quivalnc G a ss Objct List Storag Travrsal Now lt us xamin som mthods of incrasing th fficincy of th travrsal phas of bintrs and octrs.

70 Prcomputation of Intrsction Distancs Travrsal of a spatial mdian subdividd tr can b spdd up by prcomputing information for ach possibl sizd voxl in th tr. In a spatial mdian subdividd octr of hight h thr ar at most h diffrnt voxl sizs. This is also tru of a bintr whr th axis of subdivision cycls through th coordinats as th lvl incrass. For a givn ray, w can comput and stor th paramtric distanc along th ray for ach of th thr pairs of facs for ach possibl voxl siz. Th travrsal algorithm would thn b rcursiv, xamining th intrsction of th ray with intrior nods to dtrmin which childrn to dscnd. In ordr to do this, th intrsction of th ray with th voxl dgs would hav to b rcursivly maintaind. Figur 3.10 dpicts an intrior nod in a bintr, for which w know ths intrsction points in trms of th paramtric valu t. Adding th prcomputd valu for th distanc to th splitting plan for this nod siz to th valu of th lft dg, th valu of t at th intrsction with th splitting plan can b dtrmind. Dtrminating which child to xamin or th ordr of xamination can now b accomplishd with two comparisons Exit Point Computation On major cost of travrsal of a bintr or octr is th computation of th xit point of th ray from th currnt laf. A simpl coding of this computation was providd in Figur 2.6. As mntiond prviously, th spd of this computation can b nhancd by ralizing that for a givn ray, th ray nvr xits th box by th lowr bound of a coordinat if th dirction vctor of th ray is positiv in that coordinat, and similarly for th uppr bound, if th ray dirction is ngativ in that coordinat. This mans w nd to tst th ray against only thr of th six sids of a box, which can b dtrmind from xamining th dirction vctor of th ray. Evn mor savings rsults if w liminat th intrmdiat calculation of th paramtr t. With

71 61 i.. * i i i.. i i...-r! i t = lookup \ t =' 3.4 Figur 3.10 Prcom putation for Fast Travrsal ' t = 5.6 prcomputation, it is possibl to comput th valu of any coordinat of th ray at a givn valu of anothr coordinat with on multiplication and on addition. This mans, for instanc, that w can comput th y valu of th ray whr it intrscts th x fac of th box (th dg prpndicular to th x axis whr th ray could possibly xit th box) with on multiplication and on addition. By comparing this valu of y with th y limits of th box and rpating this for othr coordinats, it can b dtrmind from which fac th ray xits. Lt us assum that th componnts of th ray dirction ar positiv and that w hav prcomputd th valus, ^ x,y > B x,y > ^ x, z * B x,z fiy jx > ^y^c» ^ y,z > ^y,z,^z^c ^ z,y > ^ z,y whr, for xampl, th x-valu of th intrsction of th ray with th plan y=y 1 is computd as x = Y 1 + BXty Th psudocod for dtrmining which fac is xitd and th x,y,z valu of th point of xit is givn in Figur Not that this procdur assums that th coordinats of th ray dirction ar all positiv. Similar cod is

72 rquird for th othr cass of ray dirctions. PROCEDURE RayBoxExitPoint( RayOrigin, RayDlrctlon. Box, VAR Exit : Point; VAR lavsby : FacNam ) CONST Dimnsions = 3; VAR tmin, tmax, tlow, thigh, tntr, txit : REAL; BEGIN Yx := Ay<x *BoxHighj + B y j ; IF Yx < B o x Wgh y THEN (* dos n o t lav by y fac *) Z z,= Axz *BoxHigh z + Bxz, IF Xz > BoxHighj T H E N (* lavs by x fac *) lavsby := xfac ; z i = Az<x *BoxHighyX + BZwX; ELSE (* lavs by z fac *) lavsby := zfac ; Z z -= A y,z *B 0 X High z + Byt I ', ENDIF; ELSE Zz,= AyiZ *BoxHjgh z + By j ; IF Yz < BoxHigh>y THEN (* lavs by z fac *) lavsby := zfac ;,= Ax,* *BoxHigh z + Bx z ; ELSE (* lavs by y fac *) lavsby := yfac ; Xy.= AZ y ^BOX/Jjgh y + Bx y AZ,y BOXffjg^ y + BZty, ENDIF; ENDIF; END RayBoxExit; Figur 3.11.

73 63 This procdur taks on avrag two comparisons and 3 multiplications and additions to dtrmin th point of xit of th ray from th box and on of th facs on which this point xists. This procdur dos not add an offst to th point to guarant that it is within th nxt laf, bcaus th nighbour links mthod dos not rquir it. It could b addd to th procdur at a cost of two additional comparisons and on addition, which could thn b usd with Glassnr s algorithm to spd it up. A furthr improvmnt to th travrsal algorithm is to rduc th numbr of floating point oprations vn furthr. Considr Figur 3.12, which dpicts a st of two dimnsional lavs and a ray passing through it. Th ray is tstd against th indicatd plan four tims, onc for ach laf with that plan as a limit. Ths rdundant computations can b rducd by kping track of flags to indicat whthr th limit plans ar th sam as for th prvious laf, in conjunction with a rcursiv travrsal lik that of th ARTS mthod. On flag pr coordinat is rquird to indicat whthr th intrsction tst of th corrsponding bounding plan with th ray should b prformd. Each flag should b st aftr prforming th intrsction tst and rst whnvr travrsal from on laf to th nxt laf changs th corrsponding bounding plan. Th dtction of this bounding plan chang is simpl. Assuming that th ray has positiv x dirction, th flag for th x coordinat should b rst whnvr a downward travrsal mts th lft subnod of a nod that is dividd along th x axis, and whnvr latr upward travrsal rachs this nod again. This rsults in at most on ray-plan tst pr slicing plan, rathr than thr pr laf. Exprimntal rsults indicat that this can rduc th avrag numbr of ray-plan tsts to two pr laf.

74 64 Figur Anothr mthod of spding up th dtrmination of th fac xitd also rquirs som prcomputation. By inspcting th ntranc point of th ray with a voxl, it is somtims trivial to dtrmin which fac is xitd. Considr Figur If th ray ntrs within th squar rgion A, thn it must xit through th x fac. If it ntrs blow th dottd lin, thn it cannot xit via th y fac. Similarly for th dashd lin and th z fac. Th valus of ths cutoffs dpnd on th ray dirction and th siz of th voxls, and must b prcomputd for thr sids of ach diffrnt siz voxl, for ach ray. Figur 3.13.

75 Multi-ray Travrsal A common mthod of improving th spd of highly rptitiv oprations such as th travrsal of th bintr or octr is to capitaliz on cohrnc, which is th similarity of an opration with prvious oprations. Ray-to-ray cohrnc rfrs to th liklihood that th currnt ray bing tracd is similar to th prvious ray tracd [Sp85]. Taking advantag of such cohrnc rquirs us to b abl to rus som of th computation prformd for th prvious ray so as to sav computation tim for th currnt ray. All th spac subdivision algorithms dscribd so far do not xploit ray-to-ray cohrnc in any way. Each ray is dalt with sparatly, gnrating a uniqu tr travrsal. It may b advantagous to dal with svral rays during on tr travrsal, thrby dividing th travrsal ovrhad ovr svral rays. On way to xploit ray-to-ray cohrnc is to trac svral rays having a common origin in on tr travrsal. Considr Figur 3.14, which dpicts rays and bintr nods in two dimnsions for simplicity. Th rays displayd hav th sam origin, and intrsct th larg displayd box. Th splitting plan for this box is also shown. If th rays ar organizd by dirction, it is simpl to dtrmin th substs A and B, which ar th rays that intrsct th lft subnod and th right subnod, rspctivly. For xampl, th subst A is th st of rays which hav slops that ar on th countrclockwis sid of point 1, which can b dtrmind by inspcting th vctor from th origin to point 1. This procss can b applid rcursivly to th lft subnod, thn th right subnod, thrby travrsing th tr with many rays. As th nods visitd gt smallr (dpr in th tr), th numbr of rays from th original group intrscting th nods dcrass. Whn this numbr drops blow som thrshold valu, th rays ar tracd singly, in th convntional mannr, through th small nods.

76 66 This mthod rquirs xtra spac for th rays bing tracd. Howvr, if a sufficint numbr of rays ar usd pr tr travrsal, th avrag ovrhad pr ray can b rducd. This mthod can b applid to all ray tracing algorithms, bcaus vn th simplst of ray tracrs has of th ordr of 100,000 rays originating from a singl point, th y. Additionally, distributd ray tracing and othr typs of antialiasing oftn trac ovr 10 rays pr pixl. For this travrsal algorithm to b fastr than a convntional mthod, thr must b many sts of rays with idntical origins; in ray tracing situations this condition is oftn satisfid. Evn mor improvmnt can b achivd by modifying this multi-ray travrsal algorithm to work with groups of rays with origins that ar not ncssarily coincidnt, but clos to ach othr. This can b accomplishd by first finding th bounding volum containing th origins of th st of rays. Th rays ar still organizd with rspct to slop, th only diffrnc bing th computation of th rang of slops

77 67 which intrsct a givn subnod. In th prvious mthod th slop of th lins from th subnod s cornrs to th common point of origin ar found and usd to dtrmin th rang of valid slops. In th rvisd mthod, th minimum and maximum slops of th lins from th subnod s cornrs to ach cornr of th origin bounding volum is found and usd to dtrmin th rang of valid slops. Th prvious mthod is quivalnt to this rvisd mthod whr th origin bounding volum happns to b a point. Figur 3.15 dpicts th two slops dfining th rang of rays which could possibly intrsct th lft subnod. Not that in th rvisd algorithm, it is now possibl that som rays ar within th valid rang of slops, yt do not intrsct th box in qustion. Th probability of ths fals hits incrass as th siz of th origin bounding volum incrass. So for optimum fficincy, rays must b groupd so that thr ar nough rays to raliz a gain during travrsal, but th origins must b clos nough to constrain th numbr of fals hits to a minimum. Both of ths travrsal algorithms ffctivly provid paralll travrsal of rays through th tr at a cost of th ordr of a singl ray travrsal. A similar paralll computation can b usd to comput ray-bounding volum and raypolygon intrsctions, and prhaps ray intrsctions with othr typs of objcts. Thr ar othr mthods of imag rndring similar to ray tracing, which ffctivly trac volums rathr than rays. Amanatids [Aman84] tracs cons which approximatly covr th ara of th individual pixls, thus providing an antialiasd imag. Hckbrt and Hanrahan [Hck84] swp rctangular bams through th scn to gt a rsolution-indpndnt tiling of th imag. Ths tchniqus involv tsting th scn for intrsction with cons and pyramids, rspctivly. Algorithms for ray-tracing bintrs and octrs ar asily xtndibl to handling cons or pyramids in plac of rays, whil still allowing travrsal in ordr of narnss to ray origin. In fact, th multi-ray

78 68 Figur 3.15 travrsal algorithm mntiond abov is vry similar to swping a rctangular bam through a scn, which is prformd in Hckbrt s and Hanrahan s bam tracing Expandd Lavs As a ray travls through lavs, it incurs a cost du to th ray xit point computation and th dtrmination of th nxt laf. A vry simpl way of spding up this propagation of th ray through spac is to xpand th voxl dimnsions of lavs as much as possibl. Th path of slicing plans which lad to a particular laf strictly dtrmins th spac that th laf rprsnts. Howvr, if th voxl limits ar xplicitly stord within th laf, thy do not ncssarily hav to corrspond to th voxl limits implid by th slicing plans. Undr crtain circumstancs, th stord voxl limits can b xpandd to b largr than, yt still nclos, th implicit voxl. It will b dmonstratd

79 69 that this can rduc th computation involvd in th travrsal, by numrating fwr lavs. As long as th xpandd voxl totally ncloss th original on, and th xtra volum addd to th voxl ncloss no objcts, a travrsal algorithm such as that of Fujimoto t al. or Glassnr can b usd with almost no modification. As bfor, a givn point maps, via th slicing plans, into on laf. Th advantag of this approach ariss from th fact that computing th ray xit point from an xpandd voxl may possibly giv a point within a laf that is a fw lavs farthr along th ray, so it may tak just on ray xit point computation and on travrsal to th nxt laf whr prviously it would hav takn svral. Figur 3.16 illustrats this graphically, whr Figur 3.16a rprsnts th standard voxl dimnsions in a vry simpl scn subdivision. Figur 3.16b rprsnts th sam subdivision, but th voxl stord in th laf nod containing th objcts is xpandd as shown. Th implication in Figur 3.16b is that if th ray intrscts th original voxl and dos not intrsct th objcts, thn th xit point of th xpandd voxl is computd, travrsing th scn with two lss laf visits. Thr is mor than on possibl xpansion for a givn laf. Th bst on should b slctd, according to som critria, such as largst surfac ara of th xpandd laf, or largst sum of surfac aras of lavs nclosd by th addd volum. Th xpandd laf ida may b applid to mpty lavs also, assuming that mpty lavs ar xplicitly stord. Th notion of xpandd lavs may b usd not only with th convntional algorithms, but also with th nighbour links mthod, and any travrsal algorithm which uss an xit point computation. Figur 3.17 dpicts a part of th scn containing on objct which blongs in many lavs. With traditional mthods th gain in tightly nclosing th objct (fwr intrsction tsts) is offst somwhat by th additional lavs rquird (mor lavs to travrs). Howvr, by xpanding th lavs

80 70 ray Figur 3.16 containing th objct to th laf shown, th travrsal cost is rducd signifi cantly, whil rtaining th tight nclosur around th objct.

81 Figur

82 Chaptr 4 Im plm ntation 4.1. Surfac Ara Mtric Vrification As a prliminary implmntation, th validity of th prdictions of th surfac ara mtrics givn in th prvious chaptr wr tstd. A st of 100 boxs with random sizs and positions wr cratd, whr ach box was a standard rctangular paralllpipd. 100,000 random rays wr tracd through th bounding volum nclosing th boxs. Ths rays had origins outsid th bounding volum, and wr dirctd towards th bounding volum. Th statistics rcordd ar prsntd in graphical form in Figur 4.1, whr ach point rprsnts th surfac ara of a box and th numbr of rays which intrsctd th box. Th numbr of rays intrscting a box is thus shown to b dirctly proportional to its surfac ara, numbr of rays intrscting box = surfac ara * 27.5, std. dv. = 5.2 % corrlation cof. =.995 This graph illustrats that th numbr of rays intrscting a box is proportional to its surfac ara, assuming random rays. Howvr, this dos not prov that th stimats of intrior and laf nods intrsctd ar corrct, bcaus th sarch is truncatd as soon as an intrsction is found. Th numbr of objct tsts also cannot b assumd to b provn, bcaus th stimat is drivd from an approximation of a possibly concav st of lavs by a convx volum. To tst th validity of ths stimats, a furthr simulation was prformd. Random scns of objcts, and random bintrs wr cratd, and usd to trac random rays as in th prvious simulation. Th stimatd numbrs of intrior nods, lavs, and objcts visitd wr 72

83 73 N u m Figur 4.1 compard with th actual numbrs from th ray tracing. Each scn containd a random numbr of objcts btwn 10 and 500, with random distribution in siz (dscribd in a latr sction) from.01 to 1. Th bintr cratd for th scn containd a random numbr of nods btwn 10 and 1000, whr nods wr subdividd in random ordr along a random axis at a random position within th corrsponding voxls. 529 random scns wr cratd and rays wr tracd for ach scn. Figurs 4.2, 4.3, and 4.4 graphically dpict th actual statistics vrsus th stimats, indicating th accuracy of th stimats. Th following ar th rsulting quations:

84 74 numbr of intrior nods intrsctd: actual = stimatd *.752 std. dv. = 12.7 % corrlation cof. =.945 numbr of lavs intrsctd: actual = stimatd *.831 std. dv. = 14.1 % corrlation cof. =.900 numbr of objct tsts: actual = stimatd * 1.03 std. dv. = 9.5 % corrlation cof. =.985 A c t u a 1 I n t r i o r N 0 d s 1 n t r s c t q.«figur 4.2

85 75 Figur 4.3 Th graphs show that in all cass th actual numbr is proportional to th stimatd numbr. In th cas of th numbr of intrior nods and lavs intrsctd, th stimat actually provids an uppr bound rathr than an avrag cas stimat. This is undrstandabl, as th drivation of th stimat assums that th rays hit no objcts. Th constants of proportionality may thrfor b usd in conjunction with th surfac ara mtrics to giv a mor accurat stimat of th avrag numbr of intrior nods and lavs intrsctd. Th stimat of th numbr of objcts intrsctd was shown to b quit accurat, with a constant of proportionality clos to 1. On rason that this stimat providd an avrag cas stimat, rathr than an uppr bound, is that thr ar too fw objcts in th scn. Truncating th sarch as soon as an intrsction was found probably did not sav many intrsction tsts bcaus ach ray may hav intrsctd only zro or on objcts. Thrfor th stimat providd an avrag-cas stimat. With dnsr scns, th

86 76 A ct u a 1 O bj ct T s t s Figur 4.4 objct intrsction stimat should probably b scald down in th sam way as th intrior and laf nod stimats Construction Algorithms Having vrifid th surfac ara mtric as rasonably accurat, construction of spac subdivision trs was invstigatd. Four nw construction algorithms, as wll as Kaplan s algorithm, wr implmntd for purposs of comparison and valuation. All algorithms wr implmntd on bintrs for simplicity and gnrality, but can asily b xtndd to octrs. Th construction algorithms consist of two algorithms whr th spatial mdian is chosn as th slicing plan, two algorithms whr th slicing plan can b in an arbitrary position, and Kaplan s algorithm as a standard of comparison. Ths algorithms ar:

87 77 K Kaplan s Algorithm (zro dgrs of frdom in th slicing plan slction) this is simply Kaplan s algorithm with a thrshold valu of on. Nods ar subdividd until thy contain zro or on objcts, in a bradth-first ordr. Th maximum hight of th tr was st to 30, which was flt to b larg nough not to rstrict th growth, yt provid a practical bound. This is roughly quivalnt to th valu of 10 usd by Kingdon [King86] as th maximum hight of his octrs, bcaus thr lvls of a bintr corrspond to on lvl of an octr. AA Arbitrary Acyclic (two dgrs of frdom) slicing plans can b anywhr within th nod, and a nod may b dividd along any of th thr axs. Th optimal slicing plan is dtrmind by sampling at nin qually spacd intrvals within th nod, rcording th maximum valu of th function givn in th prvious chaptr. Nin is an arbitrary paramtr chosn so as to attmpt to focus on th optimal plan, yt not incur unrasonabl amounts of computation. A nod is subdividd along whichvr axis provids th gratst gain, and nods ar subdividd according to highst gain. AC Arbitrary Cyclic (on dgr of frdom) sam as Arbitrary Acyclic, xcpt that th first lvl of subdivision always occurs along th x axis, th scond along th y axis, th third along th z axis, cycling through th thr axs. SA Spatial Mdian Acyclic (on dgr of frdom) sam as Arbitrary Acyclic, xcpt that th spatial mdian is always chosn as slicing plan. SC Spatial Mdian Cyclic (zro dgrs of frdom) sam as Arbitrary Cyclic, xcpt that th spatial mdian is always chosn as slicing plan. Ths algorithms wr ncodd as simply as possibl without any attmpts to optimiz th cod. It was flt that it was mor important that th cod b corrct, and our mphasis was vrification, rathr than fficincy.

88 78 Statistics on th trs wr rcordd at vry 50 nods during th construction of th tr. Th statistics includ th numbr of intrior nods, th numbr of mpty lavs, th numbr of non-mpty lavs (containing on or mor objcts), th stimatd numbr of lavs visitd, stimatd numbr of intrior nods visitd, and th stimatd numbr of objcts tstd for intrsction Scns Th ultimat goal of th stratgis for building th spac subdivision structurs is to improv prformanc in actual ray tracing systms. Th prformanc should thrfor b valuatd with scns that rprsnt a rasonabl sampl of all scns subjctd to ray tracing. Kingdon [King86] uss a st of svn gnral scn typs for a similar data structur valuation. Ths scn typs hav associatd paramtrs to control th numbr of objcts and distribution of objct sizs and positions. On can vary th paramtrs in an attmpt to rprsnt th rang of typical objct distributions within avrag scns. For th purposs of comparison and valuation of bintr construction algorithms, Kingdon s scn typs ar usd, as wll as similar slctions for th scn paramtrs. In ordr to rduc th amount of computation for ths tsts, only fiv of Kingdon s svn scn typs wr usd. Th two typs not usd wr lss gnral, hirarchical objct scns. Th objct distributions ar basd on thr simpl random numbr gnrators: i/3, which slcts a random point within a unit sphr; U, which slcts a random point on th unit sphr; and U, which rturns th output of U scald by a Gaussian distributd random numbr with a man of 0 and varianc of 1. Th fiv scn typs ar: small sphrical a st of triangls whos first vrtics ar i/3 distributd in spac and whos othr two vrtics ar.01*c/ distributd offsts from th first point,

89 79 larg sphrical a st of triangls whos first vrtics ar t/3 distributd in spac and whos othr two vrtics ar.333*uq distributd offsts from th first point, small Gaussian a st of triangls whos first vrtics ar.333*u distributd in spac and whos othr two vrtics ar.01*1/ distributd offsts from th first point, larg Gaussian a st of triangls whos first vrtics ar.333*u distributd in spac and whos othr two vrtics ar.333*i/ distributd offsts from th first point, thr random vrtics roughly a st of triangls whos vrtics ar t/3 distributd in spac, crating a st of dns, intrpntrating triangls. Th small sphrical and small Gaussian scns contain triangls that ar tims th width of th scn, whil th larg sphrical and larg Gaussian scns contain triangls approximatly -j- tims th width of th 6 scn, attmpting to simulat th limits of objct sizs in typical scns. Th Gaussian distribution provids a clustr of objcts whil th normal distribution provids mor sprad out objcts. Six instancs of ach scn wr usd, varying only in th numbr of objcts comprising th scn. Th numbrs usd wr 256, 512, 1024, 2048, 4096, Kingdon uss ths numbrs plus two othr smallr scn sizs (64 and 128). It was flt that th six numbrs usd wr sufficint to masur prformanc without rquiring an impractical amount of computr rsourcs. Th maximum numbr of nods was st according to th amount of tim and mmory rquird and rang from 2000 to 8000 nods, dpnding on th scn typ. Also, for som scn

90 80 typs, only th first fiv scn sizs wr usd, to limit computr usag Nighbour Links A nighbour links stratgy was implmntd, using th simpl dfinition of nighbours which givs xactly on nighbour pr fac, as opposd to th complt nighbour links stratgy. On instanc of ach of th fiv scn typs was usd to build an arbitrary acyclic typ bintr, with th nighbour links for ach laf computd. All scns had 1000 objcts and th bintrs constructd containd 1000 nods. Aftr building th bintrs, random rays wr tracd and th numbr of parnt-to-child and child-to-parnt movmnts wr rcordd, for ach of th convntional travrsal algorithms and th nighbour links mthod. Ths numbrs indicat th savings in travrsal cost by using th nighbour links stratgy.

91 Chaptr 5 Rsults 5.1. Construction Algorithms Data from th construction simulations is includd in graphical form in th appndix. In summary, th stimatd numbr of nods and lavs visitd for a givn scn wr vry similar ovr all fiv algorithms, as is vidnt from xamining th graphs. Ovrall, th arbitrary acyclic algorithm prformd slightly bttr than th rst, in trms of numbr of nods and lavs visitd. Howvr, th numbr of objcts intrsctd varid widly ovr th diffrnt construction algorithms. For this rason and bcaus th objct cost is typically highr than th othr two costs, lt us concntrat on th numbr of objcts intrsctd in ordr to valuat th algorithms prformanc. For th small sphrical and small Gaussian scn typs, th arbitrary acyclic algorithm prformd th bst, providing up to thr ordrs of magnitud rduction in th numbr of objcts tstd for intrsction. For th larg sphrical and larg Gaussian scn typs, th arbitrary acyclic algorithm was also th bst, but only up to on ordr of magnitud bttr. Howvr, for th scns consisting of thr random vrtics, th Kaplan mthod prformd bst. Th gnral rul sms to b that th arbitrary acyclic algorithm prforms bst for scns with non-ovrlapping small objcts, whil Kaplan s prforms bst for dnsr scns with intrconnctd objcts. Th xplanation for this bhavior is that th arbitrary acyclic algorithm is a grdy algorithm, govrning th subdivision by only looking on stp in advanc. If subdividing a nod is not immdiatly advantagous, thn it is not subdividd, vn if subjcting th nod to two lvls of subdivision would b advantagous. Kaplan s algorithm, by virtu of its bradth-first natur and 81

92 82 an inability to valuat th bnfit of subdividing a nod, may subdivid a nod many tims, rsulting in a gain whr th arbitrary acyclic algorithm would not. Ths obsrvations indicat that a hybrid of th arbitrary acyclic and Kaplan s algorithms might provid optimum prformanc in all scn typs. A hybrid implmntation was prformd whr th arbitrary acyclic algorithm was applid to a nod first to dtrmin an optimum splitting plan. If it dos not find a spd gain abov a crtain thrshold dpndnt upon th surfac ara of th nod, thn th spatial mdian is chosn. Th coordinat is dpndnt on th lvl of th nod, similar to Kaplan s mthod xcpt that nods ar only subdividd with on lvl of subdivision at onc (rathr than thr lvls). This forcs th algorithm to assum that subdividing a nod rsults in a dcras in cost, vn if th on-stp lookahad indicats an incras. Thus, a nod which th original algorithm dos not find advantagous to subdivid may b subdividd by th hybrid algorithm, rsulting in a tr with a highr cost than if th nod rmaind a laf. Th childrn of this nod may thn b subdividd, possibly rsulting in an ovrall dcras in th cost of th tr. Th abov procss is usd, as in th othr algorithms, only to dtrmin th splitting plan, splitting coordinat, and stimatd gain, if it wr to b subdividd. Th slction of th nxt nod to subdivid is, as in th arbitrary acyclic algorithm, th nod which has th highst stimatd gain. Howvr, whn th hybrid algorithm rsorts to slcting th spatial mdian, th gain associatd with this split is st at th thrshold, rathr than th actual valu, which would b lowr. This hybrid algorithm was run on ach of th fiv scn typs containing 1024 objcts, xcpt for th scn typ containing thr random vrtics, which had only 64 objcts for fficincy. As th following graphs indicat, it prforms bttr ovrall than any of th othr algorithms (it was outprformd slightly by th arbitrary acyclic algorithm in th cas of a larg Gaussian scn). It is intrsting to not that th portions of

93 83 th graphs prtaining to Kaplan s algorithms oftn contain lin sgmnts and abrubt changs of slop. Ths ar du to th fact that aftr som point in th construction of th tr, Kaplan s algorithm ssntially builds th tr lvl by lvl. Th lin sgmnt portions corrspond to individual lvls, and th abrupt changs in slop corrspond to th filling of a lvl. /

94 84 io 1024 Small Sphrical Objcts N u ' 0*0 O 1 A O' B J c t T s t s p r R ay Numbr of Lavs Lgnd: Arbitrary Acyclic o o Arbitrary Cyclic Spatial Mdian Acyclic Spatial Mdian Cyclic V V Kaplan (Spatial Mdian) X X Hybrid Kaplan/Arbitrary Acyclic

95 85 N um b r o O b j c t T s t s p r R ay Lgnd: Numbr of Lavs Arbitrary Acyclic o o Arbitrary Cyclic Spatial Mdian Acyclic Spatial Mdian Cyclic V V Kaplan (Spatial Mdian) X X Hybrid Kaplan/Arbitrary Acyclic

96 86 N um b r o f <y O J ct T s t s p r R ay Numbr of Lavs Lgnd: o Arbitrary Acyclic o Arbitrary Cyclic Spatial Mdian Acyclic Spatial Mdian Cyclic V V Kaplan (Spatial Mdian) X X Hybrid Kaplan/Arbitrary Acyclic

97 87 N u o ' O» > o» t o a * B J c t T s t s p r R a y A r b i t r a r y A c y c l i c O O A r b i t r a r y C y c l i c S p a t i a l M d i a n A c y c l i c S p a t i a l M d i a n C y c l i c V V K a p l a n ( S p a t i a l M d i a n ) X X H y b r i d K a p l a n / A r b i t r a r y A c y c l i c

98 Thr Random Vrtics Objcts 65 <> N 60 - u m b 55 - r o f O b j c t T s t 30 - ( 25-i7 s p r R a y N u m b r o f L a v s A r b i t r a r y A c y c l i c O O A r b i t r a r y C y c l i c S p a t i a l M d i a n A c y c l i c S p a t i a l M d i a n C y c l i c V V K a p l a n ( S p a t i a l M d i a n ) X X H y b r i d K a p l a n / A r b i t r a r y A c y c l i c

99 89 At th nd of ach simulation, th total numbr of objct instancs (numbr of objcts stord at th lavs) wr rcordd. Th arbitrary algorithms producd nar optimum numbrs, that is, only 1 0 or 2 0 prcnt mor objct instancs than objcts, whil Kaplan s and th othr two spatial mdian algorithms producd trs with up to tn tims as many objct instancs as objcts. Th rason for this is th implicit motivation to kp objcts in as fw lavs as possibl, providd by th cost function usd in slcting th splitting plan for arbitrary subdivision Nighbour Links Th following tabl summarizs th numbr of parnt-to-child and childto-parnt travrsals rcordd from th nighbour link simulation. Up / Down Travrsals, 1000 nods Scn Typ Up Down Nighbours Down 1000 Small Sphrical Larg Sphrical Small Gaussian Larg Gaussian Random Vrts Tabl 5.1. If it is assumd that th cost of a singl upward travrsal is quivalnt to a singl downward travrsal, thn ths numbrs show that th nighbour link schm dcrass th travrsal cost to btwn -7 - and -7 - of th cost of an 7 4 ARTS-typ travrsal mthod.

100 Summary It has bn dmonstratd that th cost of ray tracing spac subdivision trs can b rprsntd by th numbr of intrior nods, lavs, and objcts visitd pr ray, and th rspctiv costs of ths visits. This thsis rports nw construction algorithms which rprsnt considrabl improvmnt ovr convntional mthods, in trms of rducing th numbr of nods, lavs, and objcts visitd by a ray. Similar improvmnts may b providd by using arbitrarily orintd slicing plans (not just major plans) to add mor frdom to th subdivision procss. Th fficincy of travrsal has bn improvd by attacking its two main costs, th procssing of intrior nods in bintrs and octrs and th computation of th ray xit point. Th nighbour link stratgy introducd in this thsis significantly rducs th numbr of intrior nods visitd, whil a nw coding of th ray xit point computation that is arithmtically lss complx is providd. Th fficincy of travrsal may also b improvd by th multipl ray travrsal schm. Finally, th numbr of lavs travrsd is dcrasd furthr by allowing xpandd lavs, which can b mployd in conjunction with any of th travrsal schms Suggstd Furthr Work Som of th idas in this thsis hav bn implmntd only to a limitd xtnt, whil othrs hav not bn implmntd at all. Furthr implmntation is dfinitly rquird in ordr to valuat and rfin th suggstions. As statd arlir thr ar som issus not dalt with in this thsis. Th idas hrin should b xamind with rspct to othr aras such as highrdimnsional data structurs and/or dynamic data structurs, and multiprocssor algorithms. Th construction algorithms advancd in this thsis, whil providing improvmnts, ar vry primitiv. Th basic problm with thm is that thy choos th optimal slicing plan for ach stag of subdivision, which is not

101 91 ncssarily th optimal ovrall subdivision. In ffct, th algorithms choos local maxima, without using global information. Rsarch should b applid to improving th subdivision procss by making th procss lss localizd. A simpl way is to prform lookahad of svral lvls of subdivision pr nod, as opposd to on. Othr mthods should also b invstigatd. Th nw construction algorithms, as wll as th convntional Kaplan algorithm, prform badly as th objcts bcom mor dnsly distributd and intrpntrating. Mthods of slcting splitting plans for such situations should b invstigatd. A lookahad of svral lvls of subdivision and varying th diffrnt slicing plans involvd would, prhaps, b applicabl to ths typs of situations, although probably computationally xpnsiv. Sinc th concpt of a hirarchical xtnts tr is simply th dual of spac subdivision, many of th idas within this thsis can b applid to HE trs. Th multipl ray travrsal schm can b applid asily to HE trs. In fact, tracing multipl rays through an HE tr would b lss complx than for spac subdivision trs. Thr ar also many possibilitis for dfining construction algorithms basd on th surfac ara mtric. On huristic for slcting two bounding volums to partition a st of objcts would b to first find th two objcts of th st which imply a bounding volum with th largst surfac ara. Ths two objcts should not, thrfor, blong to th sam bounding volum. Thy can b usd as th starting point for th algorithm. On by on, ach of th rmaining objcts ar addd to on of th two sts. Th choic dpnds on which on rsults in th minimum sum of th surfac aras of th two bounding volums surrounding th two sts. This can b xtndd to any numbr of partitions. A partitioning algorithm of this sort may b a usful basis for a construction algorithm for HE trs. In gnral, th surfac ara mtric is usful for constructing any sort of structur that is to b usd for ray tracing or for answring quris involving objct-objct intrsction tsts.

102 92 Although this thsis has concntratd havily on using octrs and bintrs for ray tracing, th spac subdivision trs dscribd may b usful for othr imag rndring algorithms. As mntiond in Chaptr 3, octrs and bintrs may b usd for con tracing and bam tracing rndring algorithms. As gnral structurs for organizing multidimnsional data, spac subdivision trs may b applid to many problms which involv sarching in multidimnsional spac.

103 93 Rfrncs [Ahuj84] Ahuja, N. and Nash, C., Octr Rprsntations of Moving Objcts. Computr Vision, Graphics, and Imag Procssing, 26, 1984, pp [Anam84] Anamatids, J., Ray Tracing with Cons, Computr Graphics, 18(3), July, 1984, pp [Carl85] Carlbom, I., and Chakravarty, I., A Hirarchical Data Structur for Rprsnting th Spatial Dcomposition of 3-D Objcts, IEEE Computr Graphics and Applications, 5(4), April, 1985, pp [Cook84] Cook, R. L., Portr, T., and Carpntr, L., Distributd Ray Tracing, Procdings of SIGGRAPH 84, July, 1984, pp [Dipp84] Dipp6, M.A.Z., and Swnsn, J., An Adaptiv Subdivision Algorithm and Paralll Architctur for Ralistic Imag Synthsis, Procdings of SIGGRAPH 84, July, 1984, pp [Dipp85] Dipp6, M.A.Z., and Wold, E.H., Antialiasing Through Stochastic Sampling, Computr Graphics, 19(3), July, 1985, pp [Doct81] Doctor, L., and Torborg, J., Display Tchniqus for Octr- Encodd Objcts, IEEE Computr Graphics and Applications, 1(3) July, 1981, pp

104 94 [Dyr82] Dyr, C.R., Th Spac Efficincy of Quadtrs, Computr Graphics and Imag Procssing, 19(4), August, 1982, p [Dub8 6] Dubtz, M.H., Ray Tracing Algorithms for Computr Graphics, Ph.D. Thsis, Univrsity of Albrta, [Fil85] Fild, D.E., Fast Hit Dtction for Disjoint Rctangls, Univrsity of Watrloo Rsarch Rport, Dcmbr, [Four82] Fournir, A., Fussl, D., and Carpntr, L., Computr Rndring of Stochastic Modls, Communications of th ACM, 25(6), Jun, 1982, pp [Fuch80] Fuchs, H., Kdm, Z.M., and Naylor, B.F., On Visibl Surfac Gnration By A Priori Tr Structurs, Procdings of SIGGRAPH 80, July 14-18, [Fuji8 6 ] Fujimoto, A., Tanaka, T., and Iwata, K., ARTS: Acclratd Ray-Tracing Systm, IEEE Computr Graphics and Applications, 4(10), Octobr, 1984, pp [Glas84] Glassnr, A.S., Spac Subdivision for Fast Ray Tracing, IEEE Computr Graphics and Applications, 4(10), Octobr, 1984, pp [Glas87a] Glassnr, A.S., An Ovrviw of Ray Tracing, SIGGRAPH 1987 Introduction to Ray Tracing Cours Nots, July, 1987, pp

105 95 [Glas87b] Glassnr, A.S., Surfac Physics for Ray Tracing, SIGGRAPH 1987 Introduction to Ray Tracing Cours Nots, July, 1987, pp [Glas87c] Glassnr, A.S., Spactim Ray Tracing for Animation, SIGGRAPH 1987 Introduction to Ray Tracing Cours Nots, July, 1987, pp [Glas8 8] Glassnr, A.S., Spactim Ray Tracing for Animation, IEEE Computr Graphics and Applications, March, 1988, pp [Gold87] Goldsmith, J. and Salmon, J., Automatic Cration of Objct Hirarchis for Ray Tracing, IEEE Computr Graphics and Applications, May, 1987, pp [Hain87] Hains, E., Essntial Ray Tracing Algorithms, SIGGRAPH 1987 Introduction to Ray Tracing Cours Nots, July, 1987, [Hall83] Hall, R. A., and Grnbrg, D. P., A Tstbd for Ralistic Imag Synthsis, IEEE Computr Graphics and Applications, 3(8), Novmbr, 1983, pp [Hanr87] Hanrahan, P., A Survy of Ray-Surfac Intrsction Algorithms, SIGGRAPH 1987 Introduction to Ray Tracing Cours Nots, July, 1987, pp [Hck82] Hckbrt, P.S., Color Imag Quantization for Fram Buffr Display, Procdings of SIGGRAPH '82, July 26-30, 1982, pp [Hck84] Hckbrt, P.S., and Hanrahan, P., Bam Tracing Polygonal Objcts, Computr Graphics, 18(3), July, 1984, pp

106 96 [Jack80] Jackins, C. L., and Tanimoto, S. L., Oct-Trs and Thir Us in Rprsnting Thr-Dimnsional Objcts, Computr Graphics and Imag Procssing, 14, 1980, pp [Kapl85] Kaplan, M. R., Th Uss of Spatial Cohrnc in Ray Tracing, SIGGRAPH 85 Cours Nots 11, July 22-26, [Kaji83] Kajiya, J. T., Nw Tchniqus for Ray Tracing Procdurally Dfind Objcts, Computr Graphics, 17(3), July, 1983, pp [Karl84] Karlsson, R. G., Algorithms in a Rstrictd Univrs, Univrsity of Watrloo Rsarch Rport, Novmbr, [Kay8 6] Kay, T. L., and Kajiya, J. T., Ray Tracing Complx Scns, Computr Graphics, 20(4), August, 1986, pp [King8 6] Kingdon, S. J., Spding Up Ray-Scn Intrsctions, Mastr Thsis, Univrsity of Watrloo, [L85] L, M. E., Rdnr, R. A., and Uslton, S. P., Statistically Optimizd Sampling for Distributd Ray Tracing, Computr Graphics, 19(3), July, 1985, pp [MacD8 6 ] MacDonald, J. D., Quadtrs in Computr Graphics, Bachlor Thsis, St. Francis Xavir Univrsity, March, [Nmo8 6] Nmoto, K., and Takao, O., An Adaptiv Subdivision by Sliding Boundary Surfacs for Fast Ray Tracing, Procdings of Graphics Intrfac 86, 1986, pp

107 97 [Rubi80] Rubin, S. M., and Whittd, T., A Thr-Dimnsional Rprsntation for Fast Rndring of Complx Scns, Computr Graphics, 14(3), July, 1980, pp [Sam84] Samt, H., Th Quadtr and Rlatd Hirarchical Data Structurs, Computing Survys, 16(2), Jun, 1984, pp [Sp85] Spr, L. R., DRos, T. D., and Barsky, B. A., A Thortical and Empirical Analysis of Cohrnt Raytracing, Procdings of Graphics Intrfac '85, Montral, Qubc, 1985, pp [Sp87] Spr, L.R., A Survy of Algorithms for Fast Raytracing, SIG- GRAPH 1987 Introduction to Ray Tracing Cours Nots, July, 1987, [Ston75] Ston, L., Thory of Optimal Sarch, Acadmic Prss, Nw York, 1975, pp [Sw8 6 ] Swny, M.A.J., and Bartls, R.H., Ray-Tracing Fr-Form B-Splin Surfacs, IEEE Computr Graphics and Applications, 6(2), Fbruary, 1986, pp [Wgh84] Wghorst, H., Hoopr, G., and Grnbrg, D. P., Improvd Computational Mthods for Ray Tracing, ACM Transactions on Graphics, 3(1), January, 1984, pp [Wyvi8 6] Wyvill, G., Kunii, T.L., and Shirai, Y., Spac Division for Ray Tracing in CSG, IEEE Computr Graphics and Applications, 6(4), April, 1986, pp

108 98 [Whit80] Whittd, T., An Improvd Illumination Modl for Shadd Display, Communications of th ACMy 23(6), Jun, 1980,

109 Appndix A Graphical Rsults of Construction Algorithms Objcts Th following ar graphs of stimatd numbr of objct intrsction tsts pr ray travrsal vrsus th numbr of lavs (mpty plus non-mpty). Only th data for 2 sizs of ach scn ar prsntd, du to spac considrations. Ths scn sizs ar 1024 objcts and th largst numbr of objcts run, xcpt in th TRV cas whr data for 64 and 1024 objcts ar prsntd. Th graphs of ths scn sizs ar rprsntativ of th othr sizs as wll. Th following ar for scn siz

110 100 N u <ro **' o -i «o* B J c t T s t s p r R ay Lgnd: N u m b r o f L a v s A r b i t r a r y A c y c l i c O O A r b i t r a r y C y c l i c S p a t i a l M d i a n A c y c l i c S p a t i a l M d i a n C y c l i c V V K a p l a n ( S p a t i a l M d i a n )

111 Larg Sphrical Objcts N u m b r o f O b j c t T s t s P r R a y N u m b r o f L a v s L g n d : A r b i t r a r y A c y c l i c O O A r b i t r a r y C y c l i c S p a t i a l M d i a n A c y c l i c S p a t i a l M d i a n C y c l i c V V K a p l a n ( S p a t i a l M d i a n )

112 102 N u m b r o f r o J c t T s t s p r R ay Lgnd: N u m b r o f L a v s A r b i t r a r y A c y c l i c O O A r b i t r a r y C y c l i c S p a t i a l M d i a n A c y c l i c S p a t i a l M d i a n C y c l i c V V K a p l a n ( S p a t i a l M d i a n )

113 103 N u <TB r o f O b j c t T s t s p r R a y A r b i t r a r y A c y c l i c O O A r b i t r a r y C y c l i c S p a t i a l M d i a n A c y c l i c S p a t i a l M d i a n C y c l i c V V K a p l a n ( S p a t i a l M d i a n )

114 Thr Random Vrtics Objcts 1000 N u (T O»> O >1 «IT 3 J c t T s t s p r R a y vvww vww w w v WWW WW W W v w V W W V 0 L g n d : i N u m b r o f L a v s 1500 A r b i t r a r y A c y c l i c O O A r b i t r a r y C y c l i c S p a t i a l M d i a n A c y c l i c S p a t i a l M d i a n C y c l i c V V K a p l a n ( S p a t i a l M d i a n )

115 105 Lavs pr ray. Th following ar th analogous graphs for numbr of lavs intrsctd

116 106 N u m b r 0 f L a v s 1 n t r s c t a m P r R a y 1 i) 0 T N u m b r o f L a v s L g n d : o O A A r b i t r a r y A c y c l i c r b i t r a r y C y c l i c S p a t i a l M d i a n A c y c l i c S p a t i a l M d i a n C y c l i c V V K a p l a n ( S p a t i a l M d i a n )

117 Larg Sphrical Objcts N u m b r 0 f L a v s 9-1 n t r s c t CL» P r R a y a 7 o - - Lgnd: 500 T Numbr of Lavs Arbitrary Acyclic O O Arbitrary Cyclic Spatial Mdian Acyclic Spatial Mdian Cyclic V V Kaplan (Spatial Mdian) T I 5000

118 Small Gaussian Objcts N u m 9 b r 0 f L a 8 7 v s 6 1 n t r s c t 5 4 I 3 Q. a P r 2 - R a y Numbr of Lavs Lgnd: Arbitrary Acyclic o O Arbitrary Cyclic Spatial Mdian Acyclic Spatial Mdian Cyclic V V Kaplan (Spatial Mdian)

119 109 N u t t f t «-» f t f t w > > i f t * - * 3 i - * «> ft < OJ ft t- * «> O «i ft O ' B P r R a y Lgnd: Arbitrary Acyclic O O Arbitrary Cyclic Spatial Mdian Acyclic Spatial Mdian Cyclic V V Kaplan (Spatial Mdian) Numbr of Lavs 2500

120 110 N u 9 - o.<t'-»nnw>"nnr-»3i i w a < p> n f 1 m o ^ o cr Thr Random Vrtics Objcts <5 X7 9 v 7^ 7V^XPXp'C7V,xP xp o0 q 0 OOOOOOOOOOOOOOOD g030 C 0... <3 -,XPS xpxpxp* xps P 2 - r R h i 0 Lgnd: Arbitrary Acyclic o o Arbitrary Cyclic Spatial Mdian Acyclic Spatial Mdian Cyclic V V Kaplan (Spatial Mdian) Numbr of Lavs i 1500

121 I l l Nods Th following ar th analogous graphs for numbr of intrior nods intrsctd.

122 1 12 N um b r 0 f 1 n t r i o r N 0 d s 1 n t r s c t d P r R a y Numbr of Lavs Lgnd: Arbitrary Acyclic O O Arbitrary Cyclic Spatial Mdian Acyclic Spatial Mdian Cyclic V V Kaplan (Spatial Mdian)

123 Larg Sphrical Objcts Lgnd: Arbitrary Acyclic O O Arbitrary Cyclic Spatial Mdian Acyclic Spatial Mdian Cyclic V V Kaplan (Spatial Mdian) Numbr of Lavs I 5000

CSE 272 Assignment 1

CSE 272 Assignment 1 CSE 7 Assignmnt 1 Kui-Chun Hsu Task 1: Comput th irradianc at A analytically (point light) For point light, first th nrgy rachd A was calculatd, thn th nrgy was rducd by a factor according to th angl btwn

More information

Systems in Three Variables. No solution No point lies in all three planes. One solution The planes intersect at one point.

Systems in Three Variables. No solution No point lies in all three planes. One solution The planes intersect at one point. 3-5 Systms in Thr Variabls TEKS FOCUS VOCABULARY TEKS (3)(B) Solv systms of thr linar quations in thr variabls by using Gaussian limination, tchnology with matrics, and substitution. Rprsntation a way

More information

The Size of the 3D Visibility Skeleton: Analysis and Application

The Size of the 3D Visibility Skeleton: Analysis and Application Th Siz of th 3D Visibility Sklton: Analysis and Application Ph.D. thsis proposal Linqiao Zhang lzhang15@cs.mcgill.ca School of Computr Scinc, McGill Univrsity March 20, 2008 thsis proposal: Th Siz of th

More information

8.3 INTEGRATION BY PARTS

8.3 INTEGRATION BY PARTS 8.3 Intgration By Parts Contmporary Calculus 8.3 INTEGRATION BY PARTS Intgration by parts is an intgration mthod which nabls us to find antidrivativs of som nw functions such as ln(x) and arctan(x) as

More information

To Do. Mesh Data Structures. Mesh Data Structures. Motivation. Outline. Advanced Computer Graphics (Fall 2010) Desirable Characteristics 1

To Do. Mesh Data Structures. Mesh Data Structures. Motivation. Outline. Advanced Computer Graphics (Fall 2010) Desirable Characteristics 1 Advancd Computr Graphics (Fall 200) CS 283, Lctur 5: Msh Data Structurs Ravi Ramamoorthi http://inst.cs.brkly.du/~cs283/fa0 To Do Assignmnt, Du Oct 7. Start rading and working on it now. Som parts you

More information

Problem Set 1 (Due: Friday, Sept. 29, 2017)

Problem Set 1 (Due: Friday, Sept. 29, 2017) Elctrical and Computr Enginring Mmorial Univrsity of Nwfoundland ENGI 9876 - Advancd Data Ntworks Fall 2017 Problm St 1 (Du: Friday, Spt. 29, 2017) Qustion 1 Considr a communications path through a packt

More information

Intersection-free Dual Contouring on Uniform Grids: An Approach Based on Convex/Concave Analysis

Intersection-free Dual Contouring on Uniform Grids: An Approach Based on Convex/Concave Analysis Intrsction-fr Dual Contouring on Uniform Grids: An Approach Basd on Convx/Concav Analysis Charli C. L. Wang Dpartmnt of Mchanical and Automation Enginring, Th Chins Univrsity of Hong Kong E-mail: cwang@ma.cuhk.du.hk

More information

To Do. Advanced Computer Graphics. Motivation. Mesh Data Structures. Outline. Mesh Data Structures. Desirable Characteristics 1

To Do. Advanced Computer Graphics. Motivation. Mesh Data Structures. Outline. Mesh Data Structures. Desirable Characteristics 1 Advancd Computr Graphics CSE 63 [Spring 207], Lctur 7 Ravi Ramamoorthi http://www.cs.ucsd.du/~ravir To Do Assignmnt, Du Apr 28 Any last minut issus or difficultis? Starting Gomtry Procssing Assignmnt 2

More information

Objectives. Two Ways to Implement Lists. Lists. Chapter 24 Implementing Lists, Stacks, Queues, and Priority Queues

Objectives. Two Ways to Implement Lists. Lists. Chapter 24 Implementing Lists, Stacks, Queues, and Priority Queues Chaptr 24 Implmnting Lists, Stacks, Quus, and Priority Quus CS2: Data Structurs and Algorithms Colorado Stat Univrsity Original slids by Danil Liang Modifid slids by Chris Wilcox Objctivs q To dsign common

More information

Midterm 2 - Solutions 1

Midterm 2 - Solutions 1 COS 26 Gnral Computr Scinc Spring 999 Midtrm 2 - Solutions. Writ a C function int count(char s[ ]) that taks as input a \ trminatd string and outputs th numbr of charactrs in th string (not including th

More information

To Do. Advanced Computer Graphics. Motivation. Mesh Data Structures. Outline. Mesh Data Structures. Desirable Characteristics 1

To Do. Advanced Computer Graphics. Motivation. Mesh Data Structures. Outline. Mesh Data Structures. Desirable Characteristics 1 Advancd Computr Graphics CSE 63 [Spring 208], Lctur 7 Ravi Ramamoorthi http://www.cs.ucsd.du/~ravir To Do Assignmnt, Du Apr 27 Any last minut issus or difficultis? Starting Gomtry Procssing Assignmnt 2

More information

Terrain Mapping and Analysis

Terrain Mapping and Analysis Trrain Mapping and Analysis Data for Trrain Mapping and Analysis Digital Trrain Modl (DEM) DEM rprsnts an array of lvation points. Th quality of DEM influncs th accuracy of trrain masurs such as slop and

More information

Gernot Hoffmann Sphere Tessellation by Icosahedron Subdivision. Contents

Gernot Hoffmann Sphere Tessellation by Icosahedron Subdivision. Contents Grnot Hoffmann Sphr Tssllation by Icosahdron Subdivision Contnts 1. Vrtx Coordinats. Edg Subdivision 3 3. Triangl Subdivision 4 4. Edg lngths 5 5. Normal Vctors 6 6. Subdividd Icosahdrons 7 7. Txtur Mapping

More information

Principles of Programming Languages Topic: Formal Languages II

Principles of Programming Languages Topic: Formal Languages II Principls of Programming Languags Topic: Formal Languags II CS 34,LS, LTM, BR: Formal Languags II Rviw A grammar can b ambiguous i.. mor than on pars tr for sam string of trminals in a PL w want to bas

More information

TRIANGULATION OF NURBS SURFACES. Jamshid Samareh-Abolhassani. 1 Abstract

TRIANGULATION OF NURBS SURFACES. Jamshid Samareh-Abolhassani. 1 Abstract TRIANGULATION OF NURBS SURFACES Jamshid Samarh-Abolhassani 1 Abstract A tchniqu is prsntd for triangulation of NURBS surfacs. This tchniqu is built upon an advancing front tchniqu combind with grid point

More information

Shift. Reduce. Review: Shift-Reduce Parsing. Bottom-up parsing uses two actions: Bottom-Up Parsing II. ABC xyz ABCx yz. Lecture 8.

Shift. Reduce. Review: Shift-Reduce Parsing. Bottom-up parsing uses two actions: Bottom-Up Parsing II. ABC xyz ABCx yz. Lecture 8. Rviw: Shift-Rduc Parsing Bottom-up parsing uss two actions: Bottom-Up Parsing II Lctur 8 Shift ABC xyz ABCx yz Rduc Cbxy ijk CbA ijk Prof. Aikn CS 13 Lctur 8 1 Prof. Aikn CS 13 Lctur 8 2 Rcall: h Stack

More information

: Mesh Processing. Chapter 6

: Mesh Processing. Chapter 6 600.657: Msh Procssing Chaptr 6 Quad-Dominant Rmshing Goal: Gnrat a rmshing of th surfac that consists mostly of quads whos dgs align with th principal curvatur dirctions. [Marinov t al. 04] [Alliz t al.

More information

" dx v(x) $ % You may also have seen this written in shorthand form as. & ' v(x) + u(x) '# % ! d

 dx v(x) $ % You may also have seen this written in shorthand form as. & ' v(x) + u(x) '# % ! d Calculus II MAT 146 Mthods of Intgration: Intgration by Parts Just as th mthod of substitution is an intgration tchniqu that rvrss th drivativ procss calld th chain rul, Intgration by parts is a mthod

More information

Clustering Algorithms

Clustering Algorithms Clustring Algoritms Hirarcical Clustring k -Mans Algoritms CURE Algoritm 1 Mtods of Clustring Hirarcical (Agglomrativ): Initially, ac point in clustr by itslf. Rpatdly combin t two narst clustrs into on.

More information

2018 How to Apply. Application Guide. BrandAdvantage

2018 How to Apply. Application Guide. BrandAdvantage 2018 How to Apply Application Guid BrandAdvantag Contnts Accssing th Grant Sit... 3 Wlcom pag... 3 Logging in To Pub Charity... 4 Rgistration for Nw Applicants ( rgistr now )... 5 Organisation Rgistration...

More information

Reimbursement Requests in WORKS

Reimbursement Requests in WORKS Rimbursmnt Rqusts in WORKS Important points about Rimbursmnts in Works Rimbursmnt Rqust is th procss by which UD mploys will b rimbursd for businss xpnss paid using prsonal funds. Rimbursmnt Rqust can

More information

Vignette to package samplingdatacrt

Vignette to package samplingdatacrt Vigntt to packag samplingdatacrt Diana Trutschl Contnts 1 Introduction 1 11 Objctiv 1 1 Diffrnt study typs 1 Multivariat normal distributd data for multilvl data 1 Fixd ffcts part Random part 9 3 Manual

More information

Register Allocation. Register Allocation

Register Allocation. Register Allocation Rgistr Allocation Jingk Li Portlan Stat Univrsity Jingk Li (Portlan Stat Univrsity) CS322 Rgistr Allocation 1 / 28 Rgistr Allocation Assign an unboun numbr of tmporaris to a fix numbr of rgistrs. Exampl:

More information

A Brief Summary of Draw Tools in MS Word with Examples! ( Page 1 )

A Brief Summary of Draw Tools in MS Word with Examples! ( Page 1 ) A Brif Summary of Draw Tools in MS Word with Exampls! ( Pag 1 ) Click Viw command at top of pag thn Click Toolbars thn Click Drawing! A chckmark appars in front of Drawing! A toolbar appars at bottom of

More information

Dynamic Spatial Partitioning for Real-Time Visibility Determination

Dynamic Spatial Partitioning for Real-Time Visibility Determination Dynamic Spatial Partitioning for Ral-Tim Visibility Dtrmination Joshua Shagam Josph J. Pfiffr, Jr. Nw Mxico Stat Univrsity Abstract Th static spatial partitioning mchanisms usd in currnt intractiv systms,

More information

FSP Synthesis of an off-set five bar-slider mechanism with variable topology

FSP Synthesis of an off-set five bar-slider mechanism with variable topology FSP Synthsis of an off-st fiv bar-slidr mchanism with variabl topology Umsh. M. Daivagna 1*, Shrinivas. S. Balli 2 1 Dpartmnt of Mchanical Enginring, S.T.J.Institut of Tchnology, Ranbnnur, India 2 Dpt.

More information

An Architecture for Hierarchical Collision Detection

An Architecture for Hierarchical Collision Detection An Architctur for Hirarchical Collision Dtction Gabril Zachmann Computr Graphics, Informatik II Univrsity of Bonn mail: zach@cs.uni-bonn.d Güntr Knittl WSI/GRIS Univrsity of Tübingn mail: knittl@gris.uni-tubingn.d

More information

EXTENSION OF RCC TOPOLOGICAL RELATIONS FOR 3D COMPLEX OBJECTS COMPONENTS EXTRACTED FROM 3D LIDAR POINT CLOUDS

EXTENSION OF RCC TOPOLOGICAL RELATIONS FOR 3D COMPLEX OBJECTS COMPONENTS EXTRACTED FROM 3D LIDAR POINT CLOUDS Th Intrnational rchivs of th Photogrammtry, mot Snsing and Spatial Information Scincs, Volum XLI-, 016 XXIII ISPS Congrss, 1 19 July 016, Pragu, Czch public EXTENSION OF CC TOPOLOGICL ELTIONS FO D COMPLEX

More information

SPECKLE NOISE REDUCTION IN SAR IMAGING USING 2-D LATTICE FILTERS BASED SUBBAND DECOMPOSITION

SPECKLE NOISE REDUCTION IN SAR IMAGING USING 2-D LATTICE FILTERS BASED SUBBAND DECOMPOSITION 7th Europan Signal Procssing Confrnc EUSIPCO 9 Glasgow Scotland August 4-8 9 SPECKLE REDUCTION IN SAR IMAGING USING -D LATTICE FILTERS ASED SUAND DECOMPOSITION Göhan Karasaal N.. Kaplan I. Err Informatics

More information

Ray Tracing. Wen-Chieh (Steve) Lin National Chiao-Tung University

Ray Tracing. Wen-Chieh (Steve) Lin National Chiao-Tung University Ra Tracing Wn-Chih (Stv Lin National Chiao-Tung Univrsit Shirl, Funamntals of Computr Graphics, Chap 15 I-Chn Lin s CG slis, Doug Jams CG slis Can W Rnr Imags Lik Ths? Raiosit imag Pictur from http://www.graphics.cornll.u/onlin/ralistic/

More information

Reducin} Migratin} secxn:laries

Reducin} Migratin} secxn:laries Rducing Migrating Scondaris Earl Wallr and Ml Parc INLEX, Inc. P.O. Box 1349 Montry, CA. 93942 If you ar lik us, you hav rad a lot rcntly about IMAGE and its 'myths', and you know that thr can b prformanc

More information

TCP Congestion Control. Congestion Avoidance

TCP Congestion Control. Congestion Avoidance TCP Congstion Control TCP sourcs chang th snding rat by modifying th window siz: Window = min {Advrtisd window, Congstion Window} Rcivr Transmittr ( cwnd ) In othr words, snd at th rat of th slowst componnt:

More information

Spectral sensitivity and color formats

Spectral sensitivity and color formats FirWir camras Spctral snsitivity and color formats At th "input" of a camra, w hav a CCD chip. It transforms photons into lctrons. Th spctral snsitivity of this transformation is an important charactristic

More information

Acceleration of the Smith-Waterman Algorithm using Single and Multiple Graphics Processors

Acceleration of the Smith-Waterman Algorithm using Single and Multiple Graphics Processors Acclration of th Smith-Watrman Algorithm using Singl and Multipl Graphics Procssors Ali Khah-Sad, Stphn Pool and J. Blair Prot Abstract Finding rgions of similarity btwn two vry long data strams is a computationally

More information

About Notes And Symbols

About Notes And Symbols About Nots And Symbols by Batric Wildr Contnts Sht 1 Sht 2 Sht 3 Sht 4 Sht 5 Sht 6 Sht 7 Sht 8 Sht 9 Sht 10 Sht 11 Sht 12 Sht 13 Sht 14 Sht 15 Sht 16 Sht 17 Sht 18 Sht 19 Sht 20 Sht 21 Sht 22 Sht 23 Sht

More information

Introduction to Data Mining

Introduction to Data Mining Introduction to Data Mining Lctur #15: Clustring-2 Soul National Univrsity 1 In Tis Lctur Larn t motivation and advantag of BFR, an xtnsion of K-mans to vry larg data Larn t motivation and advantag of

More information

Summary: Semantic Analysis

Summary: Semantic Analysis Summary: Smantic Analysis Chck rrors not dtctd by lxical or syntax analysis Intrmdiat Cod Scop rrors: Variabls not dfind Multipl dclarations Typ rrors: Assignmnt of valus of diffrnt typs Invocation of

More information

The Network Layer: Routing Algorithms. The Network Layer: Routing & Addressing Outline

The Network Layer: Routing Algorithms. The Network Layer: Routing & Addressing Outline PS 6 Ntwork Programming Th Ntwork Layr: Routing lgorithms Michl Wigl partmnt of omputr Scinc lmson Univrsity mwigl@cs.clmson.du http://www.cs.clmson.du/~mwigl/courss/cpsc6 Th Ntwork Layr: Routing & ddrssing

More information

A New Algorithm for Solving Shortest Path Problem on a Network with Imprecise Edge Weight

A New Algorithm for Solving Shortest Path Problem on a Network with Imprecise Edge Weight Availabl at http://pvamudu/aam Appl Appl Math ISSN: 193-9466 Vol 6, Issu (Dcmbr 011), pp 60 619 Applications and Applid Mathmatics: An Intrnational Journal (AAM) A Nw Algorithm for Solving Shortst Path

More information

Workbook for Designing Distributed Control Applications using Rockwell Automation s HOLOBLOC Prototyping Software John Fischer and Thomas O.

Workbook for Designing Distributed Control Applications using Rockwell Automation s HOLOBLOC Prototyping Software John Fischer and Thomas O. Workbook for Dsigning Distributd Control Applications using Rockwll Automation s HOLOBLOC Prototyping Softwar John Fischr and Thomas O. Bouchr Working Papr No. 05-017 Introduction A nw paradigm for crating

More information

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer: Routing Algorithms. Routing Algorithms Taxonomy

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer: Routing Algorithms. Routing Algorithms Taxonomy PS Intrntworking Th Ntwork Layr: Routing & ddrssing Outlin Th Ntwork Layr: Routing lgorithms Michl Wigl partmnt of omputr Scinc lmson Univrsity mwigl@cs.clmson.du Novmbr, Ntwork layr functions Routr architctur

More information

Type & Media Page 1. January 2014 Libby Clarke

Type & Media Page 1. January 2014 Libby Clarke Nam: 1 In ordr to hlp you s your progrss at th nd of this ntir xrcis, you nd to provid som vidnc of your starting point. To start, draw th a on th lft into th box to th right, dpicting th sam siz and placmnt.

More information

The semantic WEB Roles of XML & RDF

The semantic WEB Roles of XML & RDF Th smantic WEB Rols of XML & RDF STEFAN DECKER AND SERGEY MELNIK FRANK VAN HARMELEN, DIETER FENSEL, AND MICHEL KLEIN JEEN BROEKSTRA MICHAEL ERDMANN IAN HORROCKS Prsntd by: Iniyai Thiruvalluvan CSCI586

More information

Intersection-free Contouring on An Octree Grid

Intersection-free Contouring on An Octree Grid Intrsction-fr Contouring on An Octr Grid Tao Ju Washington Univrsity in St. Louis On Brookings Driv St. Louis, MO 0, USA taoju@cs.wustl.du Tushar Udshi Zyvx Corporation North Plano Road Richardson, Txas

More information

1. Trace the array for Bubble sort 34, 8, 64, 51, 32, 21. And fill in the following table

1. Trace the array for Bubble sort 34, 8, 64, 51, 32, 21. And fill in the following table 1. Trac th array for Bubbl sort 34, 8, 64, 51, 3, 1. And fill in th following tabl bubbl(intgr Array x, Intgr n) Stp 1: Intgr hold, j, pass; Stp : Boolan switchd = TRUE; Stp 3: for pass = 0 to (n - 1 &&

More information

Maxwell s unification: From Last Time. Energy of light. Modern Physics. Unusual experimental results. The photoelectric effect

Maxwell s unification: From Last Time. Energy of light. Modern Physics. Unusual experimental results. The photoelectric effect From Last Tim Enrgy and powr in an EM wav Maxwll s unification: 1873 Intimat connction btwn lctricity and magntism Exprimntally vrifid by Hlmholtz and othrs, 1888 Polarization of an EM wav: oscillation

More information

Motivation. Synthetic OOD concepts and reuse Lecture 4: Separation of concerns. Problem. Solution. Deleting composites that share parts. Or is it?

Motivation. Synthetic OOD concepts and reuse Lecture 4: Separation of concerns. Problem. Solution. Deleting composites that share parts. Or is it? Synthtic OOD concpts and rus Lctur 4: Sparation of concrns Topics: Complx concrn: Mmory managmnt Exampl: Complx oprations on composit structurs Problm: Mmory laks Solution: Rfrnc counting Motivation Suppos

More information

Forward and Inverse Kinematic Analysis of Robotic Manipulators

Forward and Inverse Kinematic Analysis of Robotic Manipulators Forward and Invrs Kinmatic Analysis of Robotic Manipulators Tarun Pratap Singh 1, Dr. P. Sursh 2, Dr. Swt Chandan 3 1 M.TECH Scholar, School Of Mchanical Enginring, GALGOTIAS UNIVERSITY, GREATER NOIDA,

More information

DO NOW Geometry Regents Lomac Date. due. Similar by Transformation 6.1 J'' J''' J'''

DO NOW Geometry Regents Lomac Date. due. Similar by Transformation 6.1 J'' J''' J''' DO NOW Gomtry Rgnts Lomac 2014-2015 Dat. du. Similar by Transformation 6.1 (DN) Nam th thr rigid transformations and sktch an xampl that illustrats ach on. Nam Pr LO: I can dscrib a similarity transformation,

More information

2 Mega Pixel. HD-SDI Bullet Camera. User Manual

2 Mega Pixel. HD-SDI Bullet Camera. User Manual 2 Mga Pixl HD-SDI Bullt Camra Usr Manual Thank you for purchasing our product. This manual is only applicabl to SDI bullt camras. Thr may b svral tchnically incorrct placs or printing rrors in this manual.

More information

Efficient Obstacle-Avoiding Rectilinear Steiner Tree Construction

Efficient Obstacle-Avoiding Rectilinear Steiner Tree Construction Efficint Obstacl-Avoiding Rctilinar Stinr Tr Construction Chung-Wi Lin, Szu-Yu Chn, Chi-Fng Li, Yao-Wn Chang, and Chia-Lin Yang Graduat Institut of Elctronics Enginring Dpartmnt of Elctrical Enginring

More information

SPECIFIC CRITERIA FOR THE GENERAL MOTORS GLOBAL TRADING PARTNER LABEL TEMPLATE:

SPECIFIC CRITERIA FOR THE GENERAL MOTORS GLOBAL TRADING PARTNER LABEL TEMPLATE: SPCIFIC CRITRIA FOR TH GNRAL MOTORS GLOBAL TRADING PARTNR LABL TMPLAT: TH TMPLAT IDNTIFIS HOW AND WHR DATA IS TO B PLACD ON TH LABL WHN IT IS RQUIRD AS PART OF A GM BUSINSS RQUIRMNT FONT SIZS AR SPCIFID

More information

i e ai E ig e v / gh E la ES h E A X h ES va / A SX il E A X a S

i e ai E ig e v / gh E la ES h E A X h ES va / A SX il E A X a S isto C o C or Co r op ra p a py ag yr g ri g g gh ht S S S V V K r V K r M K v M r v M rn v MW n W S r W Sa r W K af r: W K f : a H a M r T H r M rn w T H r Mo ns w T i o S ww c ig on a w c g nd af ww

More information

An Agent-Based Architecture for Service Discovery and Negotiation in Wireless Networks

An Agent-Based Architecture for Service Discovery and Negotiation in Wireless Networks An Agnt-Basd Architctur for Srvic Discovry and Ngotiation in Wirlss Ntworks Abstract Erich Birchr and Torstn Braun Univrsity of Brn, Nubrückstrass 10, 3012 Brn, Switzrland Email: braun@iam.unib.ch This

More information

Extending z/tpf using IBM API Management (APIM)

Extending z/tpf using IBM API Management (APIM) Extnding using API Managmnt (APIM) Mark Gambino, TPF Dvlopmnt Lab March 23, 2015 TPFUG Dallas, TX Th Big Pictur Goal Mobil Applications Cloud APIs Cloud-basd Srvics On-Prmis Entrpris APIs E n t r p r I

More information

Greedy Algorithms. Interval Scheduling. Greedy Algorithm. Optimality. Greedy Algorithm (cntd) Greed is good. Greed is right. Greed works.

Greedy Algorithms. Interval Scheduling. Greedy Algorithm. Optimality. Greedy Algorithm (cntd) Greed is good. Greed is right. Greed works. Algorithm Grdy Algorithm 5- Grdy Algorithm Grd i good. Grd i right. Grd work. Wall Strt Data Structur and Algorithm Andri Bulatov Algorithm Grdy Algorithm 5- Algorithm Grdy Algorithm 5- Intrval Schduling

More information

Interfacing the DP8420A 21A 22A to the AN-538

Interfacing the DP8420A 21A 22A to the AN-538 Intrfacing th DP8420A 21A 22A to th 68000 008 010 INTRODUCTION This application not xplains intrfacing th DP8420A 21A 22A DRAM controllr to th 68000 Thr diffrnt dsigns ar shown and xplaind It is assumd

More information

Polygonal Models. Overview. Simple Data Structures. David Carr Fundamentals of Computer Graphics Spring 2004 Based on Slides by E.

Polygonal Models. Overview. Simple Data Structures. David Carr Fundamentals of Computer Graphics Spring 2004 Based on Slides by E. INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Polygonal Modls David Carr Fundamntals of Computr Graphics Spring 200 Basd on Slids by E. Angl Fb-3-0 SMD159, Polygonal Modls 1 L Ovrviw Simpl

More information

Evolutionary Clustering and Analysis of Bibliographic Networks

Evolutionary Clustering and Analysis of Bibliographic Networks Evolutionary Clustring and Analysis of Bibliographic Ntworks Manish Gupta Univrsity of Illinois at Urbana-Champaign gupta58@illinois.du Charu C. Aggarwal IBM T. J. Watson Rsarch Cntr charu@us.ibm.com Jiawi

More information

HEAD DETECTION AND TRACKING SYSTEM

HEAD DETECTION AND TRACKING SYSTEM HEAD DETECTION AND TRACKING SYSTEM Akshay Prabhu 1, Nagacharan G Tamhankar 2,Ashutosh Tiwari 3, Rajsh N(Assistant Profssor) 4 1,2,3,4 Dpartmnt of Information Scinc and Enginring,Th National Institut of

More information

Dual-mode Operation of the Finger-type Manipulator Based on Distributed Actuation Mechanism

Dual-mode Operation of the Finger-type Manipulator Based on Distributed Actuation Mechanism 11 th World Congrss on Structural and Multidisciplinary Optimisation 07 th -1 th, Jun 015, Sydny Australia Dual-mod Opration of th Fingr-typ Manipulator Basd on Distributd Actuation Mchanism Jong Ho Kim

More information

Mesh Data Structures. Geometry processing. In this course. Mesh gallery. Mesh data

Mesh Data Structures. Geometry processing. In this course. Mesh gallery. Mesh data Gomtry procssing Msh Data Structurs Msh data Gomtry Connctivity Data structur slction dpnds on Msh typ Algorithm rquirmnts 2 Msh gallry In this cours Only orintabl, triangular, manifold mshs Singl componnt,

More information

Fuzzy Intersection and Difference Model for Topological Relations

Fuzzy Intersection and Difference Model for Topological Relations IFS-EUSFLT 009 Fuzzy Intrsction and Diffrnc Modl for Topological Rlations hd LOODY Flornc SEDES Jordi INGLD 3 Univrsité Paul Sabatir (UPS) Toulous, 8 Rout d Narbonn, F-306-CEDEX 9, Franc Institut d Rchrchn

More information

CS246: Mining Massive Datasets Jure Leskovec, Stanford University.

CS246: Mining Massive Datasets Jure Leskovec, Stanford University. CS246: Mining Massiv Datasts Jur Lskovc, Stanford Univrsity ttp://cs246.stanford.du 11/26/2010 Jur Lskovc, Stanford C246: Mining Massiv Datasts 2 Givn a st of points, wit a notion of distanc btwn points,

More information

An Auto-tuned Method for Solving Large Tridiagonal Systems on the GPU

An Auto-tuned Method for Solving Large Tridiagonal Systems on the GPU An Auto-tund Mthod for Solving Larg Tridiagonal Systms on th GPU Andrw Davidson Univrsity of California, Davis aaldavidson@ucdavis.du Yao Zhang Univrsity of California, Davis yaozhang@ucdavis.du John D.

More information

A Vision-based Navigation System of Mobile Tracking Robot

A Vision-based Navigation System of Mobile Tracking Robot A Vision-basd Navigation Systm of Mobil Tracking Robot Ji Wu Vac1av Snasl Dpt. Computr Scinc FCS VSB - Tchnical Univrsity of Ostrava Ostrava Czch Rpublic dfrmat2008 @hotmail.com vaclav. snasl @vsb.cz Ajith

More information

Parser Self-Training for Syntax-Based Machine Translation

Parser Self-Training for Syntax-Based Machine Translation arsr Slf-Training for Syntax-Basd Machin Translation Makoto Morishita, Koichi Akab, Yuto Hatakoshi Graham ubig, Koichiro Yoshino, Satoshi akamrua Graduat School of Information Scinc ara Institut of Scinc

More information

Recorder Variables. Defining Variables

Recorder Variables. Defining Variables Rcordr Variabls Dfining Variabls Simpl Typs Complx Typs List of Rsrvd Words Using Variabls Stting Action Paramtrs Parsing Lists and Tabls Gtting Valu from Lists and Tabls Using Indxs with Lists Using Indxs

More information

Managing Trust Relationships in Peer 2 Peer Systems

Managing Trust Relationships in Peer 2 Peer Systems Managing Trust Rlationships in Pr 2 Pr Systms R.S.SINJU PG STUDENT, DEPARTMENT OF COMPUTER SCIENCE, PONJESLY COLLEGE OF ENGINEERING NAGERCOIL, TAMILNADU, INDIA C.FELSY ASST.PROF, DEPARTMENT OF COMPUTER

More information

From Last Time. Origin of Malus law. Circular and elliptical polarization. Energy of light. The photoelectric effect. Exam 3 is Tuesday Nov.

From Last Time. Origin of Malus law. Circular and elliptical polarization. Energy of light. The photoelectric effect. Exam 3 is Tuesday Nov. From Last Tim Enrgy and powr in an EM wav Exam 3 is Tusday Nov. 25 5:30-7 pm, 2103 Ch (hr) Studnts w / schduld acadmic conflict plas stay aftr class Tus. Nov. 18 to arrang altrnat tim. Covrs: all matrial

More information

Linked Data meet Sensor Networks

Linked Data meet Sensor Networks Digital Entrpris Rsarch Institut www.dri.i Linkd Data mt Snsor Ntworks Myriam Lggiri DERI NUI Galway, Irland Copyright 2008 Digital Entrpris Rsarch Institut. All rights rsrvd. Linkd Data mt Snsor Ntworks

More information

Clustering Algorithms

Clustering Algorithms Clustring Algoritms Applications Hirarcical Clustring k -Mans Algoritms CURE Algoritm 1 T Problm of Clustring Givn a st of points, wit a notion of distanc btwn points, group t points into som numbr of

More information

Clustering Belief Functions using Extended Agglomerative Algorithm

Clustering Belief Functions using Extended Agglomerative Algorithm IJ Imag Graphics and Signal Procssing 0 - Publishd Onlin Fbruary 0 in MECS (http://wwwmcs-prssorg/ ing Blif Functions using Extndd Agglomrativ Algorithm Ying Png Postgraduat Collg Acadmy of Equipmnt Command

More information

Announcements. q This week s schedule. q Next week. q Grading. n Wednesday holiday. n Thursday class from am

Announcements. q This week s schedule. q Next week. q Grading. n Wednesday holiday. n Thursday class from am Announcmnts This wk s schdul n Wdnsday holiday n Thursday class from 9.00-0.30am Nxt wk n Monday and Tusday rgular class n Wdnsday Last uiz for th cours Grading n Quiz 5, 6 and Lab 6 ar du. Applications

More information

Comment (justification for change) by the MB

Comment (justification for change) by the MB Editor's disposition s CD2 19763-12 as at 2013-11-03 Srial Annx (.g. 3.1) Figur/ Tabl/t (.g. Tabl 1) 001 CA 00 All All - G Canada disapprovs th draft for th rasons blow. 002 GB 01 Gnral d numbring has

More information

Formal Foundation, Approach, and Smart Tool for Software Models Comparison

Formal Foundation, Approach, and Smart Tool for Software Models Comparison Formal Foundation, Approach, and Smart Tool for Softwar Modls Comparison Olna V. Chbanyuk, Abdl-Badh M. Salm Softwar Enginring Dpartmnt, National Aviation Univrsity, Kyiv, Ukrain Computr Scinc, Faculty

More information

Ontology and Context. Isabel Cafezeiro Departamento de Ciência da Computação Universidade Federal Fluminense Niterói - RJ, Brazil

Ontology and Context. Isabel Cafezeiro Departamento de Ciência da Computação Universidade Federal Fluminense Niterói - RJ, Brazil Ontology and Contxt Isabl Cafziro Dpartamnto d Ciência da Computação Univrsidad Fdral Fluminns Nitrói - RJ, Brazil isabl@dcc.ic.uff.br dward Hrmann Hauslr, Alxandr Radmakr Dpartamnto d Informática Pontifícia

More information

Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, Directed Graphs BOS SFO

Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, Directed Graphs BOS SFO Prsntation for us with th txtbook, Algorithm Dsign and Applications, by M. T. Goodrich and R. Tamassia, Wily, 2015 Dirctd Graphs BOS ORD JFK SFO LAX DFW MIA 2015 Goodrich and Tamassia Dirctd Graphs 1 Digraphs

More information

CC-RANSAC: Fitting Planes in the Presence of Multiple Surfaces in Range Data

CC-RANSAC: Fitting Planes in the Presence of Multiple Surfaces in Range Data CC-RANSAC: Fitting Plans in th Prsnc of Multipl Surfacs in Rang Data Orazio Gallo, Robrto Manduchi Univrsity of California, Santa Cruz Abbas Rafii Cansta, Inc. Abstract Rang snsors, in particular tim-of-flight

More information

Group 2 Mega Crystals Usability Test Report

Group 2 Mega Crystals Usability Test Report Group 2 Mga Crystals Usability Tst Rport Rport Writtn By Katrina Ellis Tam Mmbrs Usr Exprinc Consultants Katrina Ellis Zhitao Qiu HU4628 Julia Wiss Sarah Ingold Jams Staplton CS4760 Kris Gauthir (Android)

More information

View-dependent refinement of multiresolution meshes with subdivision connectivity

View-dependent refinement of multiresolution meshes with subdivision connectivity Viw-dpndnt rfinmnt of multirsolution mshs with subdivision connctivity Danil I. Azuma 1 Danil N. Wood 1 Brian Curlss 1 Tom Duchamp 1 David H. Salsin 1,2 Wrnr Stutzl 1 1 Univrsity of Washington 2 Microsoft

More information

Lesson Focus: Finding Equivalent Fractions

Lesson Focus: Finding Equivalent Fractions Lsson Plans: Wk of 1-26-15 M o n Bindrs: /Math;; complt on own, thn chck togthr Basic Fact Practic Topic #10 Lsson #5 Lsson Focus: Finding Equivalnt Fractions *Intractiv Larning/Guidd Practic-togthr in

More information

SPECIFIC CRITERIA FOR THE GENERAL MOTORS GLOBAL TRADING PARTNER LABEL TEMPLATE:

SPECIFIC CRITERIA FOR THE GENERAL MOTORS GLOBAL TRADING PARTNER LABEL TEMPLATE: SPCIFIC CRITRIA FOR TH GNRAL MOTORS GLOBAL TRADING PARTNR LABL TMPLAT: TH TMPLAT IDNTIFIS HOW AND WHR DATA IS TO B PLACD ON TH LABL WHN IT IS RQUIRD AS PART OF A GM BUSINSS RQUIRMNT FONT SIZS AR SPCIFID

More information

RFC Java Class Library (BC-FES-AIT)

RFC Java Class Library (BC-FES-AIT) RFC Java Class Library (BC-FES-AIT) HELP.BCFESDEG Rlas 4.6C SAP AG Copyright Copyright 2001 SAP AG. All Rcht vorbhaltn. Witrgab und Vrvilfältigung disr Publikation odr von Tiln daraus sind, zu wlchm Zwck

More information

Modeling Surfaces of Arbitrary Topology using Manifolds 1

Modeling Surfaces of Arbitrary Topology using Manifolds 1 Modling Surfacs of Arbitrary Topology using Manifolds 1 Cindy M. Grimm John F. Hughs cmg@cs.brown.du (401) 863-7693 jfh@cs.brown.du (401) 863-7638 Th Scinc and Tchnology Cntr for Computr Graphics and Scintific

More information

Tillförlitlig dimensionering mot utmattning UTMIS Vårmöte 2018 på Högskolan i Skövde

Tillförlitlig dimensionering mot utmattning UTMIS Vårmöte 2018 på Högskolan i Skövde Tillförlitlig dimnsionring mot utmattning UTMIS Vårmöt 2018 på Högskolan i Skövd Rami Mansour & Mårtn Olsson KTH Hållfasthtslära mart@kth.s ramimans@kth.s Introduction Ovrviw of rliabl dsign Traditional

More information

Pacing Guide for Third Grade Version 2011

Pacing Guide for Third Grade Version 2011 GLE 0306.. Undrstand th plac valu of whol numbrs to tn-thousands plac including xpandd notation for all arithmtic oprations. 0306.. Rprsnt whol numbrs up to 0,000 using various modls (such as bastn blocs,

More information

Installation Saving. Enhanced Physical Durability Enhanced Performance Warranty The IRR Comparison

Installation Saving. Enhanced Physical Durability Enhanced Performance Warranty The IRR Comparison Contnts Tchnology Nwly Dvlopd Cllo Tchnology Cllo Tchnology : Improvd Absorption of Light Doubl-sidd Cll Structur Cllo Tchnology : Lss Powr Gnration Loss Extrmly Low LID Clls 3 3 4 4 4 Advantag Installation

More information

the following minimization problem, termed as the rectilinear polygon cover problem: \Cover

the following minimization problem, termed as the rectilinear polygon cover problem: \Cover TWO GEOMETRIC OPTIMIZATION PROBLEMS BHASKAR DASGUPTA Dpartmnt of Computr Scinc Univrsity of Minnsota Minnapolis, MN 55455-0159 mail: dasgupta@cs.umn.du and VWANI ROYCHOWDHURY School of Elctrical Enginring

More information

Energy-Efficient Method to Improve TCP Performance for MANETs

Energy-Efficient Method to Improve TCP Performance for MANETs nrgy-fficint Mthod to Improv TCP Prformanc for MANTs Chaoyu Xiong, Jagol Yim, Jason Ligh and Tadao Murata Computr Scinc Dpartmnt, Univrsity of Illinois at Chicago Chicago, IL 60607, USA ABSTRACT Th currnt

More information

Multihop MIMO Relay Networks with ARQ

Multihop MIMO Relay Networks with ARQ Multihop MIMO Rlay Ntworks with ARQ Yao Xi Dniz Gündüz Andra Goldsmith Dpartmnt of Elctrical Enginring Stanford Univrsity Stanford CA Dpartmnt of Elctrical Enginring Princton Univrsity Princton NJ Email:

More information

CS364B: Frontiers in Mechanism Design Lecture #10: Coverage Valuations and Convex Rounding

CS364B: Frontiers in Mechanism Design Lecture #10: Coverage Valuations and Convex Rounding CS364B: Frontirs in Mchanism Dsign Lctur #10: Covrag Valuations and Convx Rounding Tim Roughgardn Fbruary 5, 2014 1 Covrag Valuations Rcall th stting of submodular biddr valuations, introducd in Lctur

More information

Building a Scanner, Part I

Building a Scanner, Part I COMP 506 Ric Univrsity Spring 2018 Building a Scannr, Part I sourc cod IR Front End Optimizr Back End IR targt cod Copyright 2018, Kith D. Coopr & Linda Torczon, all rights rsrvd. Studnts nrolld in Comp

More information

XML Publisher with connected query: A Primer. Session #30459 March 19, 2012

XML Publisher with connected query: A Primer. Session #30459 March 19, 2012 XML Publishr with connctd qury: A Primr Sssion #30459 March 19, 2012 Agnda/ Contnts Introduction Ovrviw of XMLP Gtting Startd Bst practics for building a basic XMLP rport Connctd Qury Basics Building a

More information

Clustering. Shannon Quinn. (with thanks to J. Leskovec, A. Rajaraman, and J. Ullman of Stanford University)

Clustering. Shannon Quinn. (with thanks to J. Leskovec, A. Rajaraman, and J. Ullman of Stanford University) Clustring Sannon Quinn (wit tanks to J. Lskovc, A. Rajaraman, and J. Ullman of Stanford Univrsity) Hig Dimnsional Data Givn a cloud of data points w want to undrstand its structur of Massiv Datasts, ttp://www.mmds.org

More information

A Loadable Task Execution Recorder for Hierarchical Scheduling in Linux

A Loadable Task Execution Recorder for Hierarchical Scheduling in Linux A Loadabl Task Excution Rcordr for Hirarchical Schduling in Linux Mikal Åsbrg and Thomas Nolt MRTC/Mälardaln Univrsity PO Box 883, SE-721 23, Västrås, Swdn {mikalasbrg,thomasnolt@mdhs Shinpi Kato Carngi

More information

Performance Analysis of IEEE MAC Protocol with Different ACK Polices

Performance Analysis of IEEE MAC Protocol with Different ACK Polices Prformanc Analysis of IEEE 82.15.3 MAC Protocol with Diffrnt Polics S. Mhta and K.S. Kwak Wirlss Communications Rsarch Cntr, Inha Univrsity, Kora suryanand.m@gmail.com Abstract. h wirlss prsonal ara ntwork

More information

I - Pre Board Examination

I - Pre Board Examination Cod No: S-080 () Total Pags: 06 KENDRIYA VIDYALAYA SANGATHAN,GUWHATI REGION I - Pr Board Examination - 04-5 Subjct Informatics Practics (Thory) Class - XII Tim: 3 hours Maximum Marks : 70 Instruction :

More information

Analysis of Influence AS Path Prepending to the Instability of BGP Routing Protocol.

Analysis of Influence AS Path Prepending to the Instability of BGP Routing Protocol. ISSN : 2355-9365 -Procding of Enginring : Vol.5, No.1 Mart 2018 Pag 1112 Analysis of Influnc AS Path Prpnding to th Instability of BGP Routing Protocol. Hirwandi Agusnam 1, Rndy Munadi 2, Istikmal 3 1,2,3,

More information

Nimsoft Monitor. ldap_response Guide. v1.3 series

Nimsoft Monitor. ldap_response Guide. v1.3 series Nimsoft Monitor ldap_rspons Guid v1.3 sris Lgal Notics Copyright 2012, Nimsoft Corporation Warranty Th matrial containd in this documnt is providd "as is," and is subjct to bing changd, without notic,

More information