Animation for the poor: 1000 HD frames in 1 hour

When I finished the plants tutorial, I was wondering what I could animate in this scene. But when I thought about 7 minutes render time per frame, I realized that I would likely not finish a 3 seconds animation.

A relative of mine posted a comment on my light streaks and he pointed out that the fog creating the light streaks is very homogenous. So I went into the Compositor and fixed it by mixing in a cloud texture on the fog. Meanwhile it’s pretty deprecated to explain, because Andrew uses the same approach in the lakes tutorial as well, but for the sake of completeness, here’s the node setup for it:

With this setting made, I got the following result (it has antialias effects because I didn’t know one needs to rerender; Andrew explained it now in the lakes tutorial):

Plants - enhanced fog

While doing this, an idea came into my mind. If it would be possible to animate the texture, I could render an animation of it and the fog looked like in motion. The only thing I didn’t want to do is rerendering the scene for every image. That’s why I saved intermediate results from the Compositor using File Output nodes. I can’t go too much into detail here, but just save the direct output of the streaks and then the scene including background into separate files (I used EXR files).

Next, open up a new blender file, delete the cube. In the render settings uncheck all passes and all includes (like sky, solid, halo) and simply setup Compositor nodes like this:

One odd thing I found is that Blender does not support vector input nodes, only value input nodes. While a value node holds only one value, a vector holds X, Y and Z values. To fake this, I am using an RGB node. Somehow the RGB values map to XYZ with the limitation that the range is from 0.0 through 1.0 only. This doesn’t matter for this scene as we need very low values anyway.

Now, extend your scene to have 1000 frames and go to frame 0. Make the color of the RGB node which is connected to Offset pure white (1,1,1), then hit the I key to insert a keyframe on it. Do the same for the RGB node which is connected to the scale input. Move over to frame 1000 and set the offset color to pink (1,0,1) and the scale color to bright pink (1, 0.7, 1). Make sure to set keyframes on both of them again.

Jump over to the video editor and make sure that the paths are linear. Press the Home button to view all and make things linear using Shift+E. Now render a single frame (F12) and it should not take longer than 3 seconds.

Ok, so if this is set up, render the animation into single pictures (full HD PNG will need 2 GB hard disk) and later combine it into a video as described by Blenderguru before. With this, I’m getting a full HD video in less than one hour which looks similar to this (note that this early version has non-linear keyframes which looks strange):

Download fog animation in full HD (26 MB) (please right click and save. Bandwidth is probably too low for streaming directly from my server)

I’m sorry I could not provide a video tutorial about it, but I’m going into holidays and wanted to share this with you before I leave. Please post any suggestions or improvements in the comments.

Reducing rendering times in the plants tutorial

Like in the grass scene, my PC is going to render for hours with all the generated ivy. So I deleted all ivy vertices which are outside the viewport of the camera, which decreased the number of vertices to only the half.

Here’s how I did it:

  • scale the camera to be as big as the ground plane
  • use the circular selection tool (C) or box tool to select all verticies of the ivy outside the camera view. Make sure to select in wireframe mode to get them all. This is probably best done in top view.
  • delete the vertices
  • repeat the same from side view to cover ivy below the camera
  • in addition, delete ivy vertices which are behind the tree trunk

But actually, this time the render process did not improve as much as I expected. Having a look at the face count at render time, it was 5.2 million faces before and 5.0 million faces after I deleted many ivy verticies. So, how could I decrease the render times further?

For me, the most important thing is to stay below a memory peak of 3,2 GB. The reason is that at this point my physical RAM ends and Windows will use the hard disk for swapping. Hard disks (150 to 600 MB/s) are slower than RAM (6000 to 17000 MB/s) by factors. In this scene, memory peak was already at 2.6 GB, so nothing really needed to be improved here.

So I continued deleting vertices:

  • repeat the steps for plants (especially ferns) as well, but
  • check whether none of the selected verticies is visible in camera view and solid mode. You shouldn’t see any yellow selection color then.

Still, things didn’t change much and I identified the subdivision surface modifiers to be the culprit. I went on and deleted all of them, just to get an idea of how much they influence the render time and the final look of the scene. Here’s the output of the finished scene before it comes to Compositing. To highlight the changes, I have created a difference picture. As you can see, deleting the subsurface modifier mainly affects the lighting. The scene becomes darker. And with a close look one can see that the tree trunk has sharp edges (but it’s not obvious, only in direct comparison I would say)

Statistics at render time
Before: 5.200.000 faces, 2.6 GB memory peak, 18 minutes render time
After: 330.000 faces, 1.1 GB memory peak, 7 minutes render time

Did this help you? How did it improve your render times? Are you interested in more performance related hints? Please leave your answers in the comments.