Iterative ray tracing