There is no error checking, texture alignment or support for non-point lights, but it's a start. Also, it's assumed all brushes are convex and manifold.