Jump to content

Simulating smoke in Blender 2.5


dsavi

Recommended Posts

In this tutorial I'll go through basic smoke simulation in Blender 2.5. You can achieve some very nice looking results with just the right knowledge. You'll also learn how to put the first tutorial into practice. If you haven't read it yet, go read it:

How to Understand the Blender User Interface

 

First some demos, however. I want you to know what kind of smoke we're talking about.

 

 

 

Yeah, that kind of smoke. This tutorial won't produce results that awesome (It would be maybe almost twice as long) but it will certainly get you started.

 

What you'll need:

 

Blender 2.53 Beta (http://blender.org)

A beverage of your choice (Depending on your weather I would either recommend lemonade or tea)

Possibly a sandwich too

 

Open up Blender, there should be a cube in the center (But not as big as in the below picture).

 

88453134.jpg

 

The cube is selected by default, if it isn't then right click on it. We're going to scale it to five times its current size.

 

Press S, (Scale) then Numpad 5 (Multiplies the size by five). Hit Enter to confirm.

 

What we are doing right now is creating the smoke domain. The smoke domain is the area that the smoke can "live" in. This restriction cuts down processing time significantly. (Otherwise Blender would have to calculate smoke physics in an infinite area, which could result in infinite processing time needed I'm not sure).

 

34151452.jpg

 

Next, in the properties window, click on the physics tab. Under a heading that says Smoke click on the Add button. Then click on Domain.

 

Next we'll add an object to emit smoke.

 

55820609.jpg

 

Press SHIFT+A (Add), select Mesh->Icosphere.

 

The problem is that now it's in the middle of the domain and we want it to be on the bottom, so that the smoke has room to rise.

 

33042308.jpg

 

Press G (Move) Z (Z axis) and move your mouse down. Click or press Enter to confirm.

 

Oops, I moved it too far (Okay so it wasn't a mistake, and it's not visible in the above picture BTW), so we need to make sure it's in the domain by switching to a side view.

 

45511325.jpg

 

Press Numpad 1 (Front view), and then Numpad 5 (Which changes the view to orthographic). Orthographic is the opposite of perspective, so lines to not converge on the horizon.

 

Now make sure that the sphere is in the domain. If it's in the square, it's inside and it's okay. If it isn't, press G and then Z again and move your mouse so that it moves up into the bottom of the domain (Leave some room below it too). Click or Enter to confirm.

 

53355196.jpg

 

I like working in perspective mode, so press Numpad 5 to go back to perspective mode.

 

The Physics tab should still be open. Again, press Add under Smoke, but this time press Flow. This means that smoke will flow out of this object. Now it's time to change some particle settings.

 

15436075.jpg

 

Go to the Particle tab, and change End to 20 and Lifetime to 5.

 

Now I'll explain what that means. Particles are just points in space, that can be used to simulate a number of things (In this case smoke emission). They can also be used to simulate liquids and Newtonian particles (Speed = 9.81m/s² etc.).

Each particle, starting from when it is emitted from the "Emittor", has a lifetime. This means it will disappear after a certain amount of frames. The "Start" and "End" values dictate when the emission will start and end. The amount is the amount of particles. So since there are 1000 particles emitted over a 20-frame period (Less than one second at 24fps), 50 particles are emitted from the object every frame.

 

Got that? Good. :razz:

It's not critical that you understand that.

 

60902897.jpg

 

Now scroll down in the particles tab to the "Velocity" header. I forgot to highlight it, but change "Normals" to 0 and "Z" to "1".

 

Whoops, I forgot something else too. Go back to the Physics tab.

 

92738259.jpg

 

Check "Inital Velocity". This means that the smoke will have momentum when it is emitted from the emitter object.

 

Time to test it out! My computer is three years old (Although it was pretty decent at the time) but this is still quite resource intensive. So don't be worried if it lags. Press ALT+A, and watch the smoke rise. (Pressing ALT+A again will pause it)

 

94903800.jpg

 

YEAH. Pretty metal. :razz:

 

But it sucked. That's not as awesome as it can be.

(Your smoke probably looks different than mine)

 

34697882.jpg

 

Let's add something for it to collide into. SHIFT+A (Add, again) Mesh->Cube.

 

97431640.jpg

 

Now to make the result more unpredictable, let's move it over a bit and make it into a cuboid.

 

First click on the red arrow and drag it in the direction of your choice.

 

91394979.jpg

 

Now let's go into the top view with Numpad 7 and resize it on the X axis by pressing S and then X, and then moving your mouse around. Click when you're done. Scale it on the Y axis a bit too. Can you guess the keyboard shortcut for that? :razz:

 

43056206.jpg

 

With that done, let's go back into the front view by pressing Numpad 1. Make it a bit thinner by scaling it on the Z axis.

 

58400039.jpg

 

Now in the smoke panel, press Add under Smoke and click Collision.

Now press ALT+A again. It should be even slower, but have patience. :-)

 

70678442.jpg

 

We need to set up a material for the domain now. Wait, the domain is only a container that should be invisible, why would we set up a material for that? Actually, the domain also acts as the only place that smoke can be rendered. It's like a machine that "Reveals" the smoke when the smoke is inside that area.

 

58018731.jpg

 

So go to the Materials tab, and click on Volume. Smoke is a volumetric material, like steam or fog. This means you can see through it, and light is scattered around in it. To put it simply. Change the Density to 0.

Why are we changing the density to 0? We will define the density by a 3D texture which has 3D pixels called voxels. (Volumetric + pixels). The density value is given to every voxel before the texture is applied, which means if we leave it at 1, we'll get a cube that just looks filled with smoke.

 

99789555.jpg

 

Go to the Textures Panel (Barely visible under that dropdown), and change the texture Type to Voxel data.

 

11440242.jpg

 

Scroll down, and under a heading that says "Influence" uncheck "Emission Color" (Here you can only see "Emission C") and check "Density". This makes so that our texture will influence the density and not, you got it, the emission color!

 

Whoops, looks like I've forgotten an image here. Somewhere in the same panel there should be a header "Voxel Data". Under that header there should be something that says "Domain object:". Click on that, and from the dropdown select "Cube".

 

Time to do a first test render! Press F12.

 

61351038.jpg

 

Well that sucks. Fortunately I know what's wrong, being all-knowing and wise as I am.

 

94087748.jpg

 

First let's just fix the camera. In the front view, (Numpad 1 if you're not already there- See the top left corner of the 3D view) zoom out a bit by scrolling down and press CTRL+ALT+Numpad 0.

 

61851003.jpg

 

Now to fix that wispy junk we got in the first render. Go to the materials tab, and change "Density scale" to 20. This basically makes it twenty times as dense.

You can render it now if you want, and you'll see the difference. (Those objects won't be black by the end of the tutorial).

 

84385223.jpg

 

But it's time to kick it up a notch. This is where the beverage and/or sandwich comes in. With your domain selected (Right click so that it's highlighted orange), go to the physics tab one last time, scroll down, and get out the big guns. First change the domain resolution "divisions" to 64. Check "Smoke high resolution", scroll down, open the panel "Smoke high resolution cache", and select "Bake all dynamics". Do not do this if your computer has less than 2GB of RAM and a 2gHz dual-core processor. Unless, of course, you have prepared a three-course meal and have lots of plans for the evening, including but not limited to theater and possibly a night on the town.

 

93404975.jpg

 

When it's done, change the frame in the timeline (The horizontal thing at the bottom) to 1, and press ALT+A. This also might take a while. When it's at a cool looking frame, hit ALT+A again (Be patient) and when it stops lagging like crazy press F12, That's more like it.

 

53636981.jpg

 

Two more things. Those other objects (The emitter and the collision object) are black in the render. Select them one at a time, go to the materials tab, scroll down to the Shadow header and check "Receive transparent". Smoke casts a shadow of varying opacity, and Blender turns off the reception of transparent shadows off by default (It's rarely used). The other thing you should do is go into the material tab with the domain selected, and change the step size to 0.05. (Scroll down).

 

Now I'm tired and can't be bothered to show you the (Quite simple) lighting setup I made. Just throw some lights in there with SHIFT+A Lamp->Point. Move 'em around a bit. You can even rotate them a bit. I honestly don't care.

 

When you're done, go to the first tab (The one all the way to the right), and change the output to AVI Jpeg if you want video or PNG if you want just a still image. If you want to render video, press CTRL+F12 after that (Look for the resulting file in C:\tmp or /tmp). Learn Sanskrit or take skydiving lessons or something. If you want a still image just press F12. That is all.

C2b6gs7.png

Link to comment
Share on other sites

Like I said I'm not actually happy until someone does one of these tutorials. Is there some tutorial that someone would actually be interested in doing that I could write?

 

Here's some I have in mind: Modeling basics (Enough so that you could go do a more advanced tutorial)

Very basic animation (Basically how to add keyframes, and a bit of graph editing, again enough so that you could do something more advanced)

Compositing basics, like depth of field, motion blur, glow, color correction etc.

Rendering and lighting basics

C2b6gs7.png

Link to comment
Share on other sites

Modelling basics would be good, e.g. modelling a vase, glass or another object not particularly difficult to model in Blender. Different methods would also be good, like extrusion for example, alongside a couple of others used to achieve if not same, similar results. :)

Link to comment
Share on other sites

  • 2 weeks later...

I will if I figure out how to make the thing work. When I start Blender, it looks normal, but when I click on anything in the Properties (at least I assume it's properties) window, it goes blank and I can't figure out how to do anything. Plus their help wiki is down atm...

 

30111yt.png

 

If I pick any of these options, that pane goes completely blank: (the toolbar/buttons disappear too)

1g64pj.png

 

And nothing happens when I select a button thingy:

711y8h.png

 

Is this applicable/does it tell us what the problem is:

50mnx5.png

 

I was going to try this tutorial, I got as far as scaling the cube... Then I can't open any menus to get to what you're talking about.

Link to comment
Share on other sites

I did that, got it to work (except Windows killed it twice) then I couldn't figure out how to save it as an image, I closed it and opened it again, and now I can't get the smoke in the animation to rise....

r73i41.png

Link to comment
Share on other sites

Save it as an image... You did render it first (Make sure the animation isn't playing back with ESC, and press F12), right? Then when it's done, press F3 and select the save location.

 

To help your second problem I would have to see the particles and physics panels with the sphere selected and the physics panel with the domain cube selected. Also, can you describe what is (Or isn't) happening?

C2b6gs7.png

Link to comment
Share on other sites

That's seven minutes for one frame, am I correct? Well In that case that's about 29 hours rendering time for the default 250 frames. Of course, RAM is by no means the main factor in rendering speed, the processor is- The RAM sort of defines the limits of what you can render, and your graphics card defines the complexity of scenes (Models/Lighting setups) that you can realistically edit.

C2b6gs7.png

Link to comment
Share on other sites

I dunno, it was actually the 'Bake All somethingshereidon'tremember' button that took the longest to work. Like I said, I don't think it ever actually rendered something because I could never get it to save a picture (then I gave up... dunno when I'll try again, probably if you make another tut).

Link to comment
Share on other sites

Yeah, but when it rendered it (when I pressed F12) it didn't really seem rendered, because it just looked like a big pile of dots... Like a really low quality render, I guess. And when I pressed F3 to save it, nothing happened.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.