Finally implemented prelighting to work correctly. We can now have as many lights as we want on the terrain.