Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!noose.ecn.purdue.edu!iuvax!shirley From: shirley@iuvax.cs.indiana.edu (peter shirley) Newsgroups: comp.graphics Subject: Re: Ray Tracing and Radiosity Message-ID: <57765@iuvax.cs.indiana.edu> Date: 10 Sep 90 15:39:02 GMT References: <11930@accuvax.nwu.edu> Organization: Indiana University, Bloomington Lines: 62 kaufman@delta.eecs.nwu.edu (Michael L. Kaufman) writes: >This may be a stupid question, but why can't radiosity be handled by ray >tracers? Also, are there any archives that contain code/papers on radiosity >that I can learn from? >Michael Ray Tracers can indeed do radiosity. Check out the Sillion and Puech paper or the Wallace et al. paper in Siggraph '89. Also the Airey et al. paper in proceedings of the symposium of Interactive 3D graphics (Computer Graphics 24 (2)), and my Graphics Interface 90 paper. Also Heckbert's Siggraph 90 paper. If all you want is a brute force radiosity code (and this code works pretty well), then start with N polygons. Each polygon will have reflectivity Ri and will emit power Ei. Assume you want to send R rays on the first pass. We will now do what amounts to physical simulation: T = 0 // T is total emitted power For i = 1 to N Ui = Ei // Ui is unsent power Pi = Ei // Pi is total power estimate T = T + Ei dP = T / R // dP is the approximate power carried by each ray For b = 1 to NumReflections For i = 1 to N r = int(Ui / dP) // patch i will send power Ui in r rays dPi = Ui / r Ui = 0 for j = 1 to r choose random direction with cosine weighting and send ray with until it hits polygon p (see Ward et al. Siggraph 88 paper equation 2 p 87) Up = Up + Rp * dPi Pp = Pp + Rp * dPi // Once this is done, we will have the power Pi coming from each surface, // Now we should convert to radiance (see my GI 90 paper or Kajiya's // Course notes in Siggraph 90 Advanced RT notes) For i = 1 to N Li = Pi / (pi * Ai) // Li is radiance, pi is 3.14..., Ai is area This ignores interpolation to polygon vertices to give a smooth image (see Cohen & Greenberg siggraph 85 figure 8A). You might also want to check out Ward et al.'s Siggraph 88 paper. Not true radiosity, but is ray tracing based and has some of the best features of ray tracing methods. If your scene is all diffuse, that method may be the way to go. Enjoy, Pete Shirley shirley@cs.indiana.edu