Working pathtracing, with global illumination and spherical light sources. The same code should work for planar light sources, but something seems to be wrong when I try this. Also, any global illumination is very slow. Optimizations are needed!