added support for lighting and less ray sweeping