I need to generate a ton of 2D images but it's taking a while. If possible I would like to use my gpus to render the images instead of my cpu. Is there a workaround for this?
-
2$\begingroup$ Cycles can use freestyle too... what i exactly your issue, I can't get it...? $\endgroup$– m.arditoCommented Apr 17, 2018 at 19:03
-
$\begingroup$ Well, all my freestyle settings go away if I pick cycle, while I was doing my research I found blender render freestyle is the go-to way for NPR rendering. I guess my question now is how do you trace a 3d cylinder into linear art style in cycle's freestyle? $\endgroup$– Inkplay_Commented Apr 17, 2018 at 19:53
1 Answer
Blender render uses the CPU only, it's not set up to use a GPU, thus using a GPU will not make it any faster.
Based off your question, I'm assuming your GPU is significantly more powerful than your CPU. I would suggest, as was mentioned above, that Cycles would be the way to go. The freestyle settings are still available in Cycles, the panel with the settings is just located a bit higher up in the properties panel, and will be disabled by default. To enable freestyle in cycles, go to the render tab, and about two-thirds of the way down enable freestyle. Then all of the settings will again be visible in the render layers tab, and they should all be the same as in Blender Render.
You can speed up Cycles significantly, as well as achieve a better non-realistic result by turning the bounces down to 0 in the light paths panel. What makes cycles realistic is how it calculates light bouncing off objects. Turning this off will make it both less realistic (more like Blender Render) as well as a whole lot faster.
Another thing is that when using freestyle, you usually don't want any kind of shading. Blender Render has the shadeless option, but cycles doesn't. A quick workaround is to use an emission shader, and in the object tab in the properties panel, down at the bottom, uncheck the Diffuse and Glossy boxes in the Cycles Settings Panel. This will make light emitted from the object not interact with any other objects in your scene.
When using emission shaders, you don't need many samples. In fact, a single sample works fine.
So to recap:
-Use Cycles
-Set bounces to 0 in the light paths panel in the render tab of the properties panel
-Use emission shaders as your materials
-Uncheck the Diffuse and Glossy boxes in the Cycles Settings panel of the Object tab of the Properties panel
-Set samples to 1
The results of this speak for themselves.
Here is a cylinder rendered with the default cycles settings, with an emission shader, the lamp deleted, and freestyle enabled:
This took just over 5 seconds to render with my CPU, and 3.2 seconds with my GPU. The optimized version looked like this:
The freestyle lines are more jagged, but there may be ways to smooth them out while using a single sample. Alternatively, you could add a few more samples, which would sacrifice a few fractions of a second for a smoother result. This image rendered in 0.08 seconds on my CPU, and 0.47 seconds on my GPU (it's normal for extremely simple scenes to take longer on a GPU).
You may have to play around a bit to find a happy medium of smoothness and speed (10 samples gave a smooth result in this case at .6 seconds on my CPU), but ultimately you should be able to get good quality images with cycles very fast.
-
$\begingroup$ Thank you for this piece of information, is it possible to distribute GPU power in parallel to work on different instances of blender? Eg. GPU1 = blender instance 1, GPU2 = blender instance 2? $\endgroup$– Inkplay_Commented Apr 18, 2018 at 14:05
-
$\begingroup$ I don't think that's possible with blender by default, but there is a script (found here: gist.github.com/Fweeb/1aca99268d150b60d5d43c8c62a53f58) that is meant to do exactly that. I've never used it, so no guarantees, but it looks simple enough to run. $\endgroup$ Commented Apr 18, 2018 at 15:30