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.

Working around Blender crashes (approach 2)

Did you ever wonder why it is possible to resize the camera in Blender? This article will explain actually the first use case I discovered for that during my trip through The Nature Academy.

With more than 100000 particles in the scene, Blenderguru found a way of bringing the PCs of participants (including myself) to the limits. People report problems rendering the scene and some are trying to reduce the amount of particles used. However, there’s a more promising approach: reducing the emitter size.

Maybe you have already noticed that the camera does not show everything of the scene. Especially parts of the ground (including grass and flowers) near the camera are not visible. The reason is that the viewport of the camera is “triangluar”. If you can get rid of the things which are not visible in the scene anyway, you can focus on things which are in the viewport.

From the top view, select the camera and scale it to a really large size; it should at least cover the ground plane, not necessarily the mountains. Everything what’s inside the camera now is rendered later. As long as you do not use reflections, everything outside the viewport can be removed without affecting the result. As we can see in the picture, this is almost half of the ground plane.

Switching into edit mode, you can delete those faces which are outside the camera. As a result, you have decreased the size of the particle emitter by about 50%.

This means that you can reduce the amount of particles by 50% as well without losing quality. As a nice side effect, render times should be faster as well. Please compare the three renders I made: the original render with 75000 particles and the reduced emitter with 37500 particles and 75000 particles.

Some more data:
75000 particles: 3250 MB peak, 7:30 minutes render time
37500 particles: 1800 MB peak, 3:45 minutes render time
75000 particles: 3200 MB peak, 7:30 minutes render time

Especially for animations this approach may significantly decrease render times and is suitable as long as you don’t need the deleted vertices. Maybe it’s bad for a camera flyover, but should work very well for animated grass like in Andrew’s video where the camera does not move.

Do you like this approach or can you think of more ideas? Feel free to use the comment function. Thank you.

Working around Blender crashes (approach 1)

In the forum at The Nature Academy, people report problems rendering the scene, just similar to what I encounter. Some of them are able to bypass the issue by turning down the number of particles in the particle system. This article describes how to retain realism with less particles. In another article, I’ll be explaining a different approach.

In his first tutorial, Blenderguru uses several particle systems for grass, long grass and flowers. The total number of particles exceeds 100000. On my PC I can use a maximum of 75000 particles and have a memory footprint of 3.2 GB – more than a 32 bit application can handle.

As a software developer, I face out of memory issues quite often. One thing to know is that the usual limit is 2.0 GB on 32 bit systems and 64 bit systems running 32 bit software. So the first thing to check on a 64 bit system is whether you have the 64 bit software running. This should probably solve it best because you can just use 100000 particles then. By the way, you can’t run 64 bit software on 32 bit systems, unfortunately.

For those who don’t have the chance running the 64 bit version of Blender, you can reduce the number of particles, but it will of course change the overall look of your scene. Less particles means less grass and more ground. During the lesson, Blenderguru just gives the ground a brown color, because we won’t see the ground anyway. With reduced particles, the ground will get visible and the pure brown color looks ugly:

This can be fixed using an appropriate texture. The good news is that Andrew provides textures for download and there are textures matching our scene. The one I found is grass_patchy_with_leaves.jpg. With particles reduced to 75000 and the texture used, my first render looks like this:

However, there’s a problem now: in the tutorial, we set the bottom of the grass to black. With reduced particles, there’s less grass which implies that there’s more sunlight coming down the the grass’ bottom. For more realism we should change the color to a more green value. So here it is, my final suggestion for a solution with reduced particles.

The render time is about 7 minutes on my PC.

What do you think of this result? Please share your thoughts using the comment function. Thank you.

Foggy mountains

For those who have seen the sneak preview of the Nature Academy, a tutorial called “Create Realistic Snowy Mountains”, I’d like to critique the resulting render a little bit. For that you know what I’m talking about, please have a look at week eight (“Mountains”). I want to let you know how fog and mountains perform together in reality, because I’m looking forward to more realistic scenes as I’m not an artist.

First thing to know is that fog is near the ground. In case it is up in the sky, fog is called “clouds” :-) . Maybe you have ever looked up into the sky vertically when it was foggy and you noticed that the sky is actually blue. At the same time you might have seen almost nothing when looking horizontally in front of you (due to the fog).

Let me show an example of a picture taken in Munich, Germany. Munich is near the Alpes, which have quite that type of mountains Andrew is creating in his tutorial. And from that photo you’ll definitely recognize that there is more fog at the bottom of the mountains than at the top. And of course there is less fog for near things like the houses – for near things close to the ground the Z buffer can be used as is.

Back to Andrew’s tutorial, he’s basically using the compositor and the Z buffer to create dust or fog. For those who downloaded the video and still have it, it’s at position 1:01:21. Actually he announced to add atmospheric glow (at 0:59:44), but anyway…

Using the Z buffer in an unmodified way means that there will be the more fog the further away things are. It does not consider the fact that looking more into the sky reduces the amount of fog. Therefore I recommend change the Z buffer before turning it into fog.

How can we achieve this in Blender? Obviously the problem comes from the compositor, so we’ll also fix it there. But first, we need an additional input for the fade out and it’ll be a texture. The texture settings are:

  • Type: Blend
  • Blend: Vertical
  • Check Ramp
  • Use white at the left
  • Use black at whatever position matches your scene best
  • Select Ease

With this texture set up, we’ll modify the Z buffer in the compositor like in the screenshot below. In order to highlight where the fog will be in the final render, I used red fog color here. The nodes are from left to right:

  • Render Layer (always needed)
  • Map Value (always needed for Z buffer to create fog)
  • new: Texture (an input node, select the just created texture)
  • new: Multiply (a color mix node)
  • Mix (always needed to mix the fog into the scene)
  • Composite or Viewer node at the end

Thank you for reading. Please share your opinions using the comment function.