A Flexible Algorithm for Multiprocessor Ray Tracing