fixed bug causing shadows to not be rendered correctly under RTree implementation