Path: utzoo!attcan!uunet!yale!coifman From: coifman@yale.UUCP (Ronald Coifman) Newsgroups: comp.graphics Subject: Re: Village Idiot asks about Ray Tracing Message-ID: <45746@yale-celray.yale.UUCP> Date: 15 Dec 88 16:10:57 GMT References: <859@amethyst.ma.arizona.edu> <3324@uoregon.uoregon.edu> <304@cs-spool.calgary.UUCP> Reply-To: musgrave-forest@yale.edu (Ken Musgrave) Organization: Yale University Computer Science Dept, New Haven CT Lines: 58 In article <5647@saturn.ucsc.edu> skinner@saturn.ucsc.edu (Robert Skinner) writes: >>> Finally, has anyone come up with a raytracer whose refraction model >>> takes into account the varying indicies of refraction of different light >>> frequencies? In other words, can I find a raytracer that, when looking >>> through a prism obliquely at a light source, will show me a rainbow? >> >> This could be tough. ... > >This is the easy part... >You fire say 16 rays per pixel anyway to do >antialiasing, and assign each one a color (frequency). When the ray >is refracted through an object, take into account the index of >refraction and apply Snell's law. A student here did that >and it worked fine. He simulated rainbows and diffraction effects >through prisms. > > (Spencer Thomas (U. Utah, or is it U. Mich. now?) also implemented >the same sort of thing at about the same time. Yep, I got a Masters degree for doing that (I was the student Rob is refer- ring to). The problem in modelling dispersion is to integrate the primary sample, over the visible frequencies of light. Using the Monte Carlo integra- tion techniques of Cook on the visible spectrum yields a nice, fairly simple solution, albeit at the cost of supersampling at ~10-20 rays per pixel, where dispersive sampling is required. Thomas used a different approach. He adpatively subdivided the spectrum based on the angle of spread of the dispersed ray, given the range of frequen- cies it represents. This can be more efficient, but can also have unlimited growth in the number of samples. Credit Spencer Thomas; he was first. As at least one person has pointed out, perhaps the most interesting aspect of this problem is that of representing the spectrum on an RGB monitor. That's an open problem; I'd be really interested in hearing about any solutions that people have come up with. (No, the obvious CIE to RGB conversion doesn't work worth a damn.) My solution(s) can be found in "A Realistic Model of Refraction for Computer Graphics", F. Kenton Musgrave, Modelling and Simulation on Microcomputers 1988 conference proceedings, Soc. for Computer Simulation, Feb. 1988, in my UC Santa Cruz Masters thesis of the same title, and (hopefully) in an upcoming paper "Prisms and Rainbows: a Dispersion Model for Computer Graphics" at the Graphics Interface conference this summer. (I can e-mail troff sources for these papers to interested parties, but you'll not get the neat-o pictures.) For a look at an image of a physical model of the rainbow, built on the dispersion model, see the upcoming Jan. IEEE CG&A "About the Cover" article. Ken Musgrave -- _____________________________________________________________________ Ken Musgrave arpanet: musgrave@yale.edu Yale U. Math Dept. Box 2155 Yale Station Primary Operating Principle: New Haven, CT 06520 Deus ex machina