The pi-engine

A master thesis on real-time global illumination

Abstract
Screenshots
Possible further work
Downloads
Demo usage
Contact
License

Abstract

This report describes the application of real-time photon mapping to enhance realism of lighting and to automate illumination work in interactive 3D applications.

The first part of this report reviews the essential theory about light and real-time photon mapping whereas the second part discusses the implementation and results in detail.

This report looks into two major problems of real-time photon mapping: to identify and remove performance bottlenecks and to reduce fluctuation and improve visual quality.

The main conflict is between image quality and real-time constraints. The key to improve quality is to increase photon and polygon count. However, increasing either of these decreases performance.

The conclusion summarizes important guidelines that must be followed to enable real-time photon mapping and describes problems that are subject to future work.

Screenshots



Direct illumination only. Notice the shadow on the floor.




Indirect illumination only. Notice the apparent color bleeding.




Indirect illumination from a flashlight with one recursion step. Notice how the floor and roof is indirectly illuminated.




Indirect illumination from from flashlight with two recursion steps. Notice that the wall around the light cone is indirectly illuminated by the second recursion.




Indirect illumination from from flashlight with one recursion step.


Possible further work

A review of the most important issues that should be implemented/investigated can be found in the conclusion of our thesis. Since we handed in our thesis, however, we have discussed a couple of new issues at the exam:

1. Mesh refinement could be done using a different algorithm. Our current implementation splits a triangle by inserting a new point on the middle of the longest edge. Our sensor suggested using a well-known technique that splits each triangle in three new by inserting a new point in the center of the triangle. Details of this technique can be found in most books on computer graphics. One could hope that this subdivision scheme would make the mesh fluctuation less visible.

2. Apparently the area estimate cannot be improved by using a convex hull; our current implementation has implemented this and one can enable/disable the convex hull area estimate from the configuration file. We did not implement the convex hull algorithm from scratch, but adopted one found here . The algorithm is actually an O(n) approximation of an otherwise O(n lg n ) time algorithm, but it can be as precise (and slow) as the normal optimal 2D-convex hull algorithm.

3. Pixel shaders could perhaps be used to make a better irradiance interpolation. First, one could replace hardware Gouraud shading with something better. Second, maybe it is possible to make some kind of filter-pass in the pixel shader that sharpened shadow/caustic boundaries and smooth out irradiance over normal diffuse surfaces.

4. Fluctuation could potentially be decreased by make the irradiance estimate a function of the new as well as older estimates. We have not experimented with this, but it should be straight-forward to implement.

5. A descrepancy analysis should be conducted. It could be handy with a more formal descrepancy analysis to determine more precisely what diffuse scattering technique that should be used.

Downloads

Below you will find the most up-to-date version of our source code and the two reports.

The full pi-engine source code
Binary examples (Win32)(Updated 06/12/03)
The pi-engine - Part I (report)
The pi-engine - Part II (report)
Exact_photon_map class

Demo usage

To run the windows binaries simply unpack and double click the XX.bat files. To costumize the program, one can edit the XX.xml configuration files in each demo directory. There is a lot of stuff that can be customized, so happy experimenting :-).

Use 'k', and 'l' to turn the models. Use the mouse to turn the view. Use 'w','a','s','z' to strafe forwards, backwards, left, and right.

Use 'v' to toggle wireframe mode, 'b' to toggle textures, and 'f' to toggle the flashlight.


Contact

You are very welcome to contact us if you have pending question about The pi-engine. Maybe you're wondering why we have chosen a particular implementation or something else. We can be reached at

Dennis Kristensen snicki@cs.auc.dk

Thorsten Jørgen Ottosen nesotto_AT_cs.auc.dk

License

Copyright (c) 1998 - 2003 Dennis Kristensen and Thorsten Jørgen Ottosen

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer, without modification, immediately at the beginning of the file.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



TOP OF PAGE