Yes, basically I’m using the virtual wall’s known modifier to filter out any ray that hits something else,
using the -ti option of rtrace.
Since the wall is huge, ultimately all rays will reach it (not interested in back-reflections in this context). Then I can use these rays as input to the second run. I don’t even have to save the results to a file, I could just pipe the output of the first rtrace call to the other.
I would like to take it a step further though, but probably will have to make some modifications to rtrace. My understanding is that since rtrace uses a queue, multiprocessing will only work if each ray pushes just one result into the queue. So I’m thinking that if I end up with just one result per ray, albeit not the first intersection result - perhaps I could still make it work with the -n option. Any thought or tips on that direction are very welcome!