Houdini week5

Smoke effect

create a circle and set it to zx plane.

create the scatter node and tick the relax iteration to let the point randomly spread on the plane.

create the attribute create node to using scatter to create smoke. set the value to 1.

to see every point’s value, you will need to create a color node. set the color type to ramp from attribute, and attribute sets as density.

and open the spreadsheet can see all the points have 1 value.

or create an attribute noise node, select attribute names float, and type density.

and connect it to color.

adjusting the remap and ramp curves and element size to get this result. the white area will create smoke and the black area won’t.

we can use the volume rasterize attribute to create fog.

and select the attributes to density. the particle size means how big every point attribute noise created will have. so we can adjust the scale and voxel size.

we can link the voxel size to the particle scale, drag the voxel size and drop on particle scale, and select relative channel reference.

and then create a null named out source.

we will do the stimulation in the dop network node.

get into the dop network, we will need to create the smoke solver_sparse to do the smoke stimulation. Mehdi explains the difference between the old smoke solver and the new smoke solver spares different.

the smoke solver sparse can optimize your stimulation, it will only stimulate in the white area that has points show up in the attribute noise.

and this will need to work up with smoke objects with sparse. and create a volume source node, smoke will need to work with volume.

first, we need to source the density in the volume source. so the source volume will be called density

and also need to name the target field to density.

remember to fill in the sop path. copy the out_source and paste to the sop path.

hit play to see the stimulation. now the smoke still not like normal smoke in real life.

we will need to add pressure and temperature. The first is to add the temperature in the attribute noise.

and then go back to the DOP network and add the temperature panel in the operations.

remember to select the temperature in the volume raterize attribute.

next is to bring back the attribute we what in sop.

we need to create a dop import field network.

drag and drop the dop network to the dop network bland and set the default object to smoke all.

and we can choose in present to select what fields we going to import.

and now we can create a light to see how th e density goes.

The next thing is to use a volume visualization node, to control the import you want.

we can turn the smoke into the fire in emission, type in temperature, and set the scale to 10.

and the emission color field also types in temperature and set it to physical blackbody, it is a difined colour ramp and now we can see the fire shows up.

we can adjust the shadow scale,density scale and so on to get the result we want.

also we can change differen type of the smoke. get back to the dop network. and using the mirco node, like the gas turbulence node.

we can try to set up different attribute in this node, like the scale, the swirl size and the pulse length.

pulse length is to control how fast the turbulence involved, if set higher it will be slower.

Smoke solver

smoke solver is the old smoke-creating node.

it will need to use the smoke object without sparse

and we will see the bounding box not moving, we need to adjust it in the smoke object.

because the division size is too big so even we set up the bounding box bigger the smoke still doesn’t have enough space or may not working.

we can go back to the geo node and check the reference number of voxel size in null node, it is 0.05 so we need to set the division number smaller. and now the smoke has more space in the bounding box.

we can also copy the voxel size parameter and relative to the division size.

now we need to set the bounding box automatic change. create a bound node, and set the size like this, the Y-axis will be bigger, because the smoke often go up,

then create a box node, and type ‘bbox()’in the size.it will have a notification under the slot.

and then type’ inside the brackets,

and then create a gas resize fluid dynamic node and connect it to pre-solve. pre solve means it will calculating this node the first.

we will see the bounding box change dynamic a little bit.

but we will see the resize not enough, we will need to go inside this node and toggle the clamp maximum

we will see the bounding box have its own size now.

Fire

to create fire we will need the fire solver, named pyrosolver.

when we click inside we will see it is using the smoke solver at last.

when we connect it with the sparse and volume source, we will see the result like this.

in the pyro solver, it contains some small solver like dissipation and turbulence.

when we remove the dissipation, we will see the effect pretty much the same as the smoke ones.

go back to the volume visualization node, adjust the emission scale attribute. and remove the density scale.

and then adding one more operation, in the volume source node. set target field to flame and source volume to density.

we can change the second source volume to density as well.

we can optimize this through the volume rasterize node and attribute noise node. remove the temperature through the attribute name from both of them. it means these nodes only use one source to calculate.

the next thing is to set the flame lifespan in the pyrosolver node, set the life span time shorter. it means the smoke will disappear earlier.

and then set the second operation scale to 0.2, in the volume source node.

now we will see it looks more like a fire.

the next step is to ass shredding, shredding is used to break the flame shape.

but we can’t see lots of differences between them, so we will add up the shredding attribute, and we can see the fire shape being breaking much more.

and then go back to the volume visualization node, select the diffuse field to density, and adjust the diffuse ramp to let the smoke not seems so white as before. now we will see it more like the bonfire.

to break the shape of smoke we can go back to the pyro solver node, set the disturbance on.

and the bonfire’s resolution depends on how many voxels you have. and the number of voxels reflect on the info of density, can be checked in the volume visualization node.

now the number is small so when I zoom in I will see my bonfire doesn’t have too many details on it.

add a gas vortex confinement to the pyro solver.

The next thing is to add the gas vortex confinement to the bonfire. it will give the smoke some subtle change.

and add the gas wind node to it. when there is too many nodes on the force input, we can add a merge node to merge these micro nodes.

the smaller voxel size is more details will be seen.

in the volume visualization node, there is a max vis res attribute, we can set the attribute here to control the output resolution.

Rendering setting

to rendering the fire we will need to set a file cache node.

and can’t be named as bgeo format, because bego format only readable in Houdini. the geo file needs to save as vdb format at the end.

The next step is to convert all the volume to VDB. adding a convert VDB node, and set convert to VDB.

then we can middle click to check the info, the density and temperature are been convert to VDB.

when I tick the velocity, I found the velocity has a three-volume, x,y, z-axis.it can be merge though the VDB vector merge node.

and to optimize the file is to add the primitive node.

go to the volume and VDB, click write 16-bit floats on.

click save to disk.

if using Arnold to render, we will need to create the Arnold volume node, and paste the file location to the volume blank.

and go to output create an Arnold node, click render the rendered image has nothing.

is because there is no shader, we need to go back to the object mode, and select the grid and tell the Arnold volume where is the shader comes from.

the Arnold volume has the original material.

but we will create an own material for this.

and the fire’s attribute can be adjusted till get the result we want.

or we can set the color base on the temperature in the standard volume.

and it can be applied the ramp RGB to the fire.

Explosion

create a sphere in the geo mode.

and turn back to the obj mode and create a few geo nodes.

create a pyro ground explosion node in the explosion node, and replace the circle node with a sphere node.

create a pyro source node, and a volume rasterize node.

and add density as your attribute.

in the pyro source node will display density attribute at the below.

delete the burn second sourcing from burn to flame source and v to the velocity node cause we don’t need this now.

and set the temperature to temperature as density to temperature.

set the buoyancy scale to 0.1 and the smoke will not grow so high.

turn the dissipation off.

set the operation to add. lower the scale number to 0.1

and now remove the cooling rate to 0.

set the pyro source to burn, and it will add the burn and temperature automatically.

delete the burn and temperature, and sourcing the density as flame.

try to put back the temperature to 1

lower the density, it can see the fire inside.

we need to smaller the sphere because the explosion that happens don’t need to be at such a big point.

add one more operation and set it from source density to divergence. this operation will expand the sphere’s original size while we hit play.

create a volume visualization node.

in the emission set temperature.

and smoke set density.

set the second operation emission to physical black body.

turn all the shape attribute on.

using shredding to break the density and we will get a result like this.

and add up the cooling rate, to cool down the temperature.

to optimize the file, Mehdi deletes the pyro source and create the attribute create node to replace it.

name density and set the value to 1.

but the result is different from the pyro source node, the pyro source node has the p scale attribute but the attribute create node doesn’t have.

so we going to plug both of them and using the attribute create node to set the keyframe.

The next set is to select the minimal opencl solve in solving parameters

and a bounding box will not be dynamic like before so we need to set up the bounding box big enough. keep adjust it till it’s fit.

and then add more details to the smoke.

set the temperature to 0.2

and more shredding to break the density.

add more emission scale and temperature.

and then it is completely the same as the flame, create a Arnold volume, paste the file name to it.