NEW!!! 3D Smoke in Blender

Well kind of faked, but it looks good.

I’m new to blender but thought you might find this interesting. I’ve been mucking around trying to get blender to render 3d volumes, over the past two weeks, instead of working. My first attempt used a 3d mesh of cubes (generated by python - my first ever script), however because blender couldn’t do any sort of volumetric fog this causes artefacts at certain angles.

http://will.thimbleby.net/downloads/smoke3.jpg

To get the cloud I just use a clouds texture scaled big mixed with a sphere blend to get a spherical cloud. All procedural.

I tried many things to try and get this looking nice including some weird alpha mapping. But in the end I gave up. So I switched to using several parallel planes all pointing towards the camera. Which looks much nicer, but wont shadow correctly.

http://will.thimbleby.net/downloads/smoke4.jpg

With a bit of work you can shadow it with only one light, creating shadow planes aligned to the light, using the same texture co-ordinates. This can look pretty awesome. I used this for my final render, check the blender file out.

http://will.thimbleby.net/downloads/smokescene.jpg

Then I got bored with clouds and wanted to do some animated smoke. So I hacked some volumetric fluid dynamics code together. Then I made it into a blender texture so I could use it in my scenes. Each time the frame increases it calculates the fluid motion. This was my first attempt.

http://will.thimbleby.net/downloads/smoke2.jpg

Which I later refined to this:

http://will.thimbleby.net/downloads/smoke.jpg

Pretty nice, huh? It looks even better in motion.

http://will.thimbleby.net/downloads/3dsmoke6.avi

Anyway I zipped up the blender file, the source code for the texture (& mac os x compiled .so file), the python script to generate the planes and a avi for your enjoyment.

http://will.thimbleby.net/downloads/3dsmoke.zip

Enjoy, make some pretty pictures, and let me know what you think.

-Will

Wow thanks! I was messing around a few days ago trying to get the first method to work, but I came to the same conclusion (artifacts at some angles) Glad you found a solution, damn it looks good too!

The volumetric clouds using planes is an old but clever technique. If you use raytracing and enable TraShadow you can get accurate shadows (but excruciatingly slowly). I’ve never noticed any artificats like that though.

As for the smoke… OOoooooooooooh !! :slight_smile:
I’m on Windows so I can’t test it though…

looks kewl!

got it to work. had to recompile the sources. for all those who dont know how to do this… the plugin doc may give you a small introduction:
http://www-users.cs.umn.edu/~mein/blender/plugins/plugindoc.html

btw… is there a possibility to decrease the calculation time? the script itself owns… but I dont want to wait that long every frame :slight_smile:

Very nice! Welcome to the community. Its nice to have people with your capablilities around. :slight_smile:

TorQ

is it possible for some kind soul to compile this for windows, I have tried myself but at the moment I can’t seem to get it to work :frowning:

Chimera : I installed lcc, How do I set my path? is there any chance if you are using windows, you could let me know how you got it to work.
( I know nothing of doing this, I just installed LCC this morning for the first time)
:o
Thanks

Ken

I’ll give it a go on my laptop here… plz do not expect anything :slight_smile:
+++edit
didn’t work… to execute implib i need dumpbin.exe and lib.exe… i guess :slight_smile: they are part of visual c++…

Thanks for the responses. :slight_smile:

I’ve updated the plugin a bit, added a load more variables to alter. Including width,height,depth, so you can speed it up. As for decreasing the execution time more, shrink the volume, plus I might be able to speed it all up but give me a bit of time. On my G4 450 it takes a small amount of the whole render time for even a simple scene.

I’ve also added a reset button, which stop the plugin from resetting each time. So you can start your render with smoke already in the air.

http://www.heathmoor.plus.com/downloads/fluid.zip

-Enjoy

PS I’ve included a Mac compiled .so, I really tried to compile it on a PC but I couldn’t figure it out. at all. If anyone could send me it compiled that’d be brilliant. -Cheers

Will

Whoa!!! Very convincing indeed! Easily the best animated “cigarette” smoke I’ve seen in Blender up to now!

anyone compile for windows? would try myself but i’m useless with that sort of thing %|

Owwww I give up have tried for a number of hours to compile this, and now have a headache, I found a copy of dumbin.exe - lib.exe - and used implib32.exe. I did get a dll, but blender just gives an error when I try to load the plugin???

I give up :frowning:

Ken

U can find fluid.dll on 3D.Blender newsGroup
posted by Lg, 18 april 2004 with attachement 26Ko

U can find fluid.dll on 3D.Blender newsGroup http://www.zoo-logique.org/3D.Blender/index.php3
and in the NewsGroup, posted by Lg, 18 april 2004 with attachement 26Ko the .dll :smiley:

LOD you were faster than me…

Hello guys!

Here are the instructions to get it to compile using LCC.
you can compile it with lcc using the -nounderscores option when linking

you need to add this line to the fluid2.c file after the other includes.
#include “stdio.h”

then replace all random() calls by rand()

save.
Then, open a console:

lcc -O -Iyourincludepath\ yoursourcepath\fluid2.dll
lcclnk -dll -nounderscores yourpath\fluid2.obj yourincludepath ex.def

There you get a dll that blender likes.

Thanks Wijt for the good job!

oh by the way it might be easier to get it from my site:
http://dani2.chez.tiscali.fr/
the link is on the forst page.

you can try the direct link if you’re lucky
http://dani2.chez.tiscali.fr/fluid2.zip

you should download Wijt’s demos to find out how the plugin works.

Ciao
Dani

wijt

when i open your scene and load the plug in and hit render the mouse curser spins for ever! do i need to compile the fluid file?

btw why do you call it fluid? can it also calculate fluid dynamics?

claas

wow, this is the thing blender needs the most! well, besides better lighting and materials that is… :smiley:
Oh yeah, and I can’t get the settings right… :frowning:

hey dani thanks for the help with compiling but i have a question.

i have tried compiling blender plugins for windows myself, but i cant get them compiling using kent meins instructions using implib.exe

if i follow your instructions

you need to add this line to the fluid2.c file after the other includes.
#include “stdio.h”

then replace all random() calls by rand()

save.
Then, open a console:

lcc -O -Iyourincludepath\ yoursourcepath\fluid2.dll
lcclnk -dll -nounderscores yourpath\fluid2.obj yourincludepath ex.def

will other texture plugins compile??
thanks heaps

(sorry for not trying this my self, my computer set up for compiling and all that isnt working atm)

heh, i’m trying…

with no luck… btw the way, i messed up…

lcc -O -Iyourincludepath\ yoursourcepath\fluid2.dll

it should be:
lcc -O -Iyourincludepath\ yoursourcepath\fluid2.c

i tried compiling briefly coulds2.c but it makes blender crash…

i do not have much time for the moment, when I have (with three/four weeks) i’ll give it a new try.

Ciao
Dani

Hi – I’m trying to finish my masters so I hadn’t noticed your questions.

Thanks Dani for your work getting it to compile -that’s great.

cekuhnen - you should just be able to install the fluid2.so file in your texture plugins directory and then render the example scene

I called in fluid because it is simple fluid dynamics. I just dictate the location of the gas and a the buoyancy so that the texture plugin buttons don’t get too overwhelming.

lemmy - keep playing with them, after my thesis is out of the way I might hack a quick opengl app that runs far faster which could then write configure files for the plugin.

I forgot I had changed the plugin so try something like:

diffusion: 0.5
viscosity: 0.06
speed: 0.05
amount: 10
bouyance: 10

size x, y, z: 50

–Will