c.. Packing of lightmaps into a large texture using binary space partitioning (From this
tutorial)

d.. Lambert Shading Model

e.. Shadow Casting with ray-plane intersections.

f.. Lightmap Filtering

g.. Octrees (Used for drawing the scene, and originally helped with shadow casting, but later
was removed)

And there the project stopped for a while. There were still inaccuracies around the edges of
individual lightmaps and the shadow casting routine was very slow, but I was happy enough to play
around with it.

Then when I actually thought about it, I figured that my method of shadow casting needed a
rewrite. It was originally simply iterating through all the triangles in the scene and tested each
one against a ray cast from each light, without any optimisations. So I sat down and sketched out a
design for shadow volumes. I'd never done any sort of research on shadow casting before so it was
my own idea, but quite a simple one.
Instead of testing each triangle, the program precomputes a truncated pyramid for each triangle in
the scene, starting at the triangle and extending out away from the lightsource, then tests if the
point is inside that.
Needless to say, the algorithm was 12 times faster than the original!

The lightmapper still needs some work, especially with smooth objects where seams can be seen, and
I'm also looking for a fast way of computing soft raytraced shadows.

The image shows the main interface for the program along with a few scenes rendered in real time
with lightmaps, and a lightmap which has been packed using the BSP method.
The lightmapper was written completely in Delphi using OpenGL for rendering.