Stocaster: Photon Mapping in Realtimeinteractive focusing and caustics | |||
|
AbstractRaster-based rendering is both common and fast, but it has some significant shortcomings. Most of these problems deal with the handling of light -- e.g. in OpenGL, the best possible lighting is eight point light sources without shadows. This means that commonly seen effects like shadows, area light sources, diffuse reflection, and caustics are not easily accomplished. Stocaster, a 3d scene graph renderer, couples the real-time performance of OpenGL with the realism of photon-mapping. An OpenGL front-end renders the scene at a smooth frame rate, while textures are regenerated concurrently in the background. Ideally, they run asychronously, so that the performance of one renderer does not significantly affect that of the other. Basic AlgorithmConstruct scene graph For each light source Generate a photon in a random direction from source Set current ray to photon trajectory While photon is alive Test scene for intersect with ray If intersect found Photon is alive Store photon hit on object Set ray origin to intersect, direction as determined by surface model Else Photon is dead For each object in scene Compile photon hits into texture Render scene in OpenGL ImplementationThe project consists of a collection of object files that manage a scene graph. It is highly modularized, and it is trivial to add a new shape, shader, etc. No specific scene is coded in, but a demo program that uses the modules is included. The entire project is coded in pure OO C++, with OpenGL interfaces. The demo program, seen below, uses GLUT to take care of the messy X11 details. ProgressCurrently implemented shapes are spheres and planes. Surface types are specular, diffuse, and refractive. Only a single wavelength is currently used. No textures are created yet-- only photon points. Sample Output2002 John Karp |