Improve lighting

Fixes #592 and good enough for #989.  Does not fix #1578.

No, we can't increase the scope of this pull request.