-print("Animating scene...")
-
-local threads = {}
-for i = 1,jobs do
- table.insert(threads, coroutine.wrap(render))
+function renderings()
+ local t = {}
+ for i = 1,jobs do
+ table.insert(t, coroutine.wrap(render))
+ end
+ local iterations = frames + jobs
+ local frame = 0
+ return function()
+ frame = frame + 1
+ if frame <= iterations then
+ local i = frame
+ if frames < i then i = null end
+ return t[1 + frame % jobs], i
+ end
+ end