6

I am trying to understand better how to create smoke/fire simulations in Blender. One of the crucial things in creating smoke/fire is how you build your smoke domain material.

Blender Internal makes use of "voxel data" to build the smoke domain material.

Voxel data renders a voxel source, working very similarly to an image texture, but in 3D. Various input data source types are available (such as smoke voxel data, or external files), as well as various interpolation methods.

Smoke Use smoke density and color as texture data. Flame Use flame temperature as texture data. Heat Use smoke heat as texture data. Values from -2.0 to 2.0 are used. Velocity Use smoke velocity as texture data.

In Cycles these simulation fields can be found in the .vdb files under the following names: color, density, heat, heat old, flame, fuel, react, velocity, shadow and texture coordinates. So I guess these simulation fields are also a sort of voxel data ?

My questions are:

  • are all voxel data always available in the smoke domain or is that determined by the flow type of the flow object ?
  • could you explain a bit more how these voxel data / simulation fields can be used in the set up of the smoke domain material

enter image description here

  • the Smoke Domain Materials I have seen so far only use density, flame and color for building the material. What could be the use of these other fields ? Could you maybe give an example ?

P.S I have studied the manual, I have seen the tutorial of Blender Guru.I want to have a deeper understanding of the Smoke Domain and the Smoke Domain Material

  • For the other voxel atributes like Heat or Velocity see this: http://blender.stackexchange.com/a/23803/7777 – Jaroslav Jerryno Novotny Oct 23 '16 at 21:23
  • @Jerryno Thanks. So next to flame, smoke density and color now heat and velocity are available ? What is the difference between flame (flame temperature) and heat ? –  Oct 24 '16 at 09:31
  • Heat is the temperature data, Flame is the density data. That's the difference. – Jaroslav Jerryno Novotny Oct 24 '16 at 13:44
  • but there is also a density keyword ... what is the difference between flame and density when it is both density (also .. flame is used for emission, that sounds not logical when flame is density ?) –  Oct 24 '16 at 14:25
  • From the emitter you have the fire, flame provides the density to control the red/yellow fire colouring. After flames you get smoke where density lets you control the black/grey of the smoke rising from the fire. – sambler Oct 24 '16 at 17:06
  • @sambler ok, but then a better word for density would have been "smoke" –  Oct 24 '16 at 17:11
  • what would be good uses of Heat in an animation ? and Velocity ? Would it also be possible to create an impact on another object with Heat ? Like let it shrink ... ? –  Oct 24 '16 at 17:13
  • That is a historic thing to stay compatible between releases. Smoke simulation existed for some time so density was relevant to the simulation, then fire was added in 2.65 and the flame property was added. – sambler Oct 24 '16 at 17:21
  • 2
    Correction: Density is the smoke's density and Flame is the smoke's emission. Flame is indeed how much light is emitted from the volume and Heat is the temperature in the volume - even the smoke can have cold and warm areas and not emit in visible light. – Jaroslav Jerryno Novotny Oct 24 '16 at 17:28
  • It feels as if even the experts don't agree on the Flame .... Some say flame density, some say smoke's emission . If the flame is the smoke's emission is it in fact not the density of the fire ? –  Oct 24 '16 at 21:41
  • I can understand light, temperature and density because they are all physics. But what physics is Flame ? –  Oct 24 '16 at 21:44
  • by the way ... If you have a look at the Voxel Data as defined in Blender Internal then the Manual says that "Flame Use flame temperature as texture data. Heat Use smoke heat as texture data." Maybe I was right when I said that Flame (in Cycles) is Flame Temperature ??? –  Oct 25 '16 at 09:15
  • @Jerryno I would really appreciate if you would explain what is Flame. See my comments above –  Oct 25 '16 at 21:14
  • @OldMan it is really what I said in the correction post. Flame is light (emission), Smoke is density, Heat is temperature. In real world the light is proportional to temperature and visible light is a subset of that light. In Cycles the simulation is not physically based but it is just some approximation with volumetric turbulent noises. Therefore I suspect that Heat is probably just smoothed and blurred Flame. You would probably get closest to real physical temperature data by combining the Flame and Heat data. – Jaroslav Jerryno Novotny Oct 26 '16 at 08:26

2 Answers2

5

I will go ahead and post this although I am not sure that it will completely satisfy all points of your question. I found this to be an interesting question that allowed me to learn some new things as I researched it, so thank you for that.

I found the currently supported attributes for smoke and fire to be located at lines 1114-1120 of blender_session.cpp as a result of finding the commit from earlier this year where official support for velocity was added. Heat was added at roughly the same time, in this commit. You can see also in the 2.78 Cycles release notes here that official support was added for heat and velocity. I was not aware that they could also be seen in /addons/cycles/kernel/kernel_types.

The description for the heat attribute (from the commit where it was added) in cycles reads as follows:

Similar to velocity, it was kind of supported by the mesh manager but was missing a code in BlenderSession to get actual values.

In Cycles Heat is an attribute which goes from -1 to 1, where -1 is the coldest ever temperature, 1 is the hottest ever one.

Now to your main points(I'll do my best):

are all voxel data always available in the smoke domain or is that determined by the flow type of the flow object ?

It appears that the data is there, but perhaps only to a certain degree, if you will. Smoke in cycles cannot become fire simply by accessing the appropriate attributes. That part would of course be determined by the flow type. To represent this, I did a test. In the following image, there are three domains that each share an identical material. The flow object in each domain is a plane, with flow type set as the text before it states. Note that here, I added the velocity attribute to flame to get the result I did with smoke. It is not clear to me exactly how velocity intended to be used, so forgive any inaccuracies in the material. I will edit and correct if I discover an error in the setup.

enter image description here

This is the node setup for the domain:

Domain material Click to enlarge

could you explain a bit more how these voxel data / simulation fields can be used in the set up of the smoke domain material

According to the manual, flame is the density of any fire in the domain. Of course, we can see that flame is the emission, and where we get the light for our fire.

density is the density of the smoke. This is a scalar value.

color is the color given to the smoke in the domain. Color and vector outputs give the same result, while factor gives an average of the channels.

The last two, heat and velocity are fairly undocumented as far as I have found. The only example of usage for heat I found was in a report on the tracker of all places. I have replicated that example here in the node setups posted. The only "official" explanation of them that I have found is what is in the commit where velocity was added for 2.78, as noted above.

the Smoke Domain Materials I have seen so far only use density, flame and color for building the material. What could be the use of these other fields ? Could you maybe give an example ?

Certainly. Here is one using both the heat and velocity attributes:

nodes Click to enlarge

The below (low sample) image is the result of the preceding node setup. Instead of using color for the smoke here, I instead used velocity, and it turns out nicely. Heat is used to drive emission along with flame.

enter image description here

I have enjoyed learning as I have researched this,and I hope that this is helpful, and that perhaps I have answered at least some points of your question well enough.

Edit:

Here is the .blend file containing the domain materials shown above.

Timaroberts
  • 12,395
  • 6
  • 39
  • 73
  • Thanks a lot for your valuable answer. Could you perhaps include a bigger image of the node setups (I cannot read them very well on my screen) ? –  Oct 29 '16 at 14:16
  • @OldMan, of course. I have added new images. They should display larger when clicked. – Timaroberts Oct 30 '16 at 06:46
  • I have a question about your last node tree. You use Velocity for creating the color of the smoke. That seems weird, can you explain ? Also could you explain that node setup (how you use for velocity for creating the smoke colour) ? –  Oct 30 '16 at 08:47
  • Heat attribute can be used (multiplied by 1500) as input for a blackbody node plugged into the emission color of the flames. – Bithur Oct 30 '16 at 08:56
  • @Bithur I did not know of the existence of the Blackbody node but I looked it up and it converts temperature to colour. Nice idea !! So Flame would not be necessary anymore ? And the control of strength of the emission, still with the heat attribute ? And how would you acquire the temperature in Fahrenheit ? –  Oct 30 '16 at 10:56
  • @OldMan heat is global (flame and smoke) so you need flame density attribute in the emission strength. As Timaroberts said, it's relative, so you can't really convert it to an exact temperature, but as it is -1 to +1, you should add 1 to make it positive (0 to +2) and then multiply to get a nice color. – Bithur Oct 30 '16 at 19:50
  • @bithur Would have been nicer when Heat was like a real physical temperature and gave temperature in fahrenheit, then your blackbody would work great !? –  Oct 30 '16 at 22:27
  • When heat would give you Fahrenheit then it would give you both color and strength of the fire (flame) is not it ? –  Oct 30 '16 at 22:33
  • @OldMan Simulation in blender is more an easy way to get artistic tools. A real simulation would need many more parameters. Imagine you have to set detailed information about air, as oxygen density, about what is your fire made of (wood, fuel, methane gas, butane gas, propergol, ..., or a mix). It would be too complex for what we want to do : fire that looks awesome! – Bithur Oct 31 '16 at 03:12
  • @Timaroberts hi. Would you consider uploading the blend file with your smoke domain material as above ? –  Nov 21 '16 at 13:23
  • @OldMan, apologies for the delay in replying. Sure I can do that. It will be later on tonight as I'm not at my computer now. There were several domain materials I had experimented with while researching, I can include a couple of them too if you'd like. – Timaroberts Nov 21 '16 at 20:37
  • @Timaroberts That would be great. I am trying to how I can get real control over the smoke and fire simulation. And the Domain Material is certainly one of the keys. So, looking forward to your upload :) –  Nov 21 '16 at 22:52
  • @OldMan, please see my edit. I have added the file with both materials shown as well as a couple others as I mentioned. – Timaroberts Nov 22 '16 at 06:02
  • @Timaroberts Thanks a lot. I guess you did not find a definition of Velocity. How would you define this attribute ? –  Nov 22 '16 at 09:04
  • @OldMan it's interesting. From what I understand and have read here and there (lost the links right now) it can be used as a texture coordinate. There just really isn't an example of how it was intended to be used as far as I can find. – Timaroberts Nov 23 '16 at 10:18
1

As a sort of "wrap up" of the comments I will answer my own question.

Available attributes from version 2.78 in a Smoke Simulation are:

  • color
  • density
  • flame
  • heat *
  • velocity *

They are now all defined in /addons/cycles/kernel/kernel_types. It is not certain if the last two keywords (heat, velocity) are yet usable (maybe in some test builds).

You can use an Attribute node with color as a keyword to read color information from smoke (use colored flow objects). The Color (of the smoke) atrtibute is more interesting if you want to mix two smokes with different colours, but if you have only one colour Color Ramp gives you more control

enter image description here

Flame is light (emission), Smoke is density, Heat is temperature. In real world the light is proportional to temperature and visible light is a subset of that light. Density is the smoke's density and Flame is the smoke's emission. Flame is indeed how much light is emitted from the volume and Heat is the temperature in the volume - even the smoke can have cold and warm areas and not emit in visible light.