InOneWeekend: multi-threaded camera render #1219
dimitry-ishenko
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is not for the faint-hearted, but the camera rendering function can be made multi-threaded by replacing inner-most loop:
with parallel version of the
std::transform_reduce()
function:You will need to include a few additional headers at the top:
And, on Linux you will need to install and link against TBB, ie:
You will also see more significant improvement if you increase
samples_per_pixel
to about 50. On my machine I was able to cut render time in half using this method.Share and enjoy.
Beta Was this translation helpful? Give feedback.
All reactions