Photon Mapping Made Easy
Photon Mapping Made Easy
GILightSrcType
scene->MaxRayPerLightSrc = 10 * 1000;
GIOBjType
scene->MaxRayTraceDepth = 3;
scene->MaxPhotonTraceDepth = 6;
GIExtObjType GIExtLight... GIExtObjIntersection GIExtLightSrc scene->photonMap.MaxPhotonSearchRadius = 2.0;
scene->ConstructScene(); // scene construction
scene->Render(cam, img); // render the scene
Figure 2: System Programming API SaveImgPPM("test.ppm", img); // Save to file
free(img.data); // free image memory
To write a program that performs photon mapping, a user return 0;
must include the header file GICore.h, define a scene class }
derived from the base class GIScene, and provide a construc-
Figure 4: The Main Program
tor. Figure 3 shows that the scene MyScene has a rectangu-
lar area light, a red sphere and a white floor, Figure 4 has
the main program that actually renders the scene, and Fig-
ure 5(a) is the result of running this program. Therefore, it is
very easy for a user to render a scene using photon mapping.
If the call to method EnablePhotonMapping() is removed,
the system will only ray trace the scene. Figure 5(b) is a
ray traced example.
8. REFERENCES
[1] J. L. Bentley, Multidimensional Binary Search Trees
in Database Applications, IEEE Transactions on
Software Engineering, Vol. 5 (1979), No. 4 (July), pp.
333–340.
[2] Andrew S, Glassner (editor), An Introduction to Ray
Tracing, Academic Press, 1989.
[3] Henrik Wann Jensen, Realistic Image Synthesis Using
Photon Mapping, A K Peters, 2001.
Figure 9: Soft Caustic [4] John L. Lowther and Ching-Kuang Shene, Rendering
+ Modeling + Animation + Postprocessing =
Computer Graphics, The Journal of Computing in
radiosity. Since it is easy to understand, students have no
Small Colleges, Vol. 16 (2000), No. 1 (November), pp.
difficulty in following the lectures and greatly enjoy photon
20–28. (reprinted in Computer Graphics, Vol. 34
mapping. This is demonstrated by the success of students’
(2000), No. 4 (November), pp. 15–18.
work on photon mapping. For example, Figure 8 is the first
successful implementation of caustic using photon mapping. [5] Dejan Nikolic and Ching-Kuang Shene,
GraphicsMentor: A Tool for Learning Graphics
An early version of the software presented here was imple-
mented by the first author of this paper when he was an Fundamentals, ACM 33rd Annual SIGCSE Technical
undergraduate student. Symposium, 2002, pp. 242-246.
[6] Ching-Kuang Shene, Raytracing as a Tool for
Learning Computer Graphics, ASEE/IEEE 32nd
Frontiers in Education, 2002, Volume III, pp.
(S4G-7)-(S4G-13).
[7] Ching-Kuang Shene, Teaching and Learning Computer
Graphics Made Easy with GraphicsMentor, Interactive
Multimedia Electronic Journal of Computer-Enhanced
Learning, October, 2002 (online journal).
[8] Peter Shirley, Realistic Ray Tracing, A K Peters, 2000.
[9] Chris Young and Drew Wells, Ray Tracing Creations,
Figure 10: Two Student Ray Tracing Images Second Edition, Waite Group Press, 1994.
Since the size of the class was small and since students fol- Acknowledgments
low different research/study paths for the second half of this The third author appreciates the hospitality of Dr. Horng-
course with many one-on-one discussions, we believe course jinh Chang, the former President of Tamkang University,
evaluation would not help draw any significant conclusion Taipei, Taiwan, and Dr. Chuan-Jen Chyan, Chair of De-
in such a non-traditional course setting. partment of Mathematics, for a short-term visit in the sum-
mer of 2004 during which the writing of this paper and other
7. CONCLUSIONS research activities were carried out.
We have presented our approach of discussing photon map-
ping in our Advanced Computer Graphics course. The
major contribution of our work is evidence showing that it
is possible to teach global illumination rendering with ray
tracing and photon mapping to undergraduate students with
very good and convincing results. Our ultimate goal is to
provide a good and easy-to-use software tool for students in
an introduction computer graphics course to explore, prac-
tice and perform photon mapping rendering. Although our
software is an API, we plan to add a command processor for
users to specify the scene without programming. A long-
term goal would be integrating GraphicsMentor and our ray
tracing and photon mapping system into a single unit so that
students can design a scene using GraphicsMentor and render
it with local illumination, ray tracing and photon mapping.
In this way, instructors may use this new system to discuss