©BBB3viz

Table of Contents

 

Overview


This tutorial is part of a guide that walks you through the process of importing and rendering Houdini simulations in 3ds Max using V-Ray. Chapter 1 assumes you are somewhat familiar with both Houdini and 3ds Max, and provides information regarding the terminology used in Houdini and V-Ray/Phoenix FD.

You can download the assets for this chapter from the button below: 

Download Assets for Chapter 1

Exporting from Houdini


Start off by creating a default Sphere in /obj and select the Fireball preset on the Pyro FX shelf.

This tutorial is focused on the relationship between Houdini's native volumes, VDBs, and the V-Ray Volume Grid. We are going to use the default settings for the Fireball preset - if you'd like to tweak it further to get something that looks nicer, feel free to edit any of the simulation parameters.

 


 

Let's take a look at what the Fireball preset generates for us.

Select the sphere1 object and use the middle mouse button over the create_fuel_volume node to bring out the Node Information window.

Note that there are 2 volumes, and the text is colored in light green. The light green color is reserved for Houdini's native volumes in the information window in SOPs.

For burning to take place during a simulation, you need a source of fuel and a source of temperature. The Fluid Source SOP is set up to generate both of these.

 


 

Next, go one level up and go to the pyro_sim. This node is the actual DOP Network where the simulation takes place.

A DOP simulation consists of an object used to define/hold all the data (such as the fields/volumes that are used in the simulation.

In this case it includes the Smoke Object node named pyro), a solver (such as the Pyro solver in this setup), helper nodes used to influence the dynamics (such as noise or the resize_container node here), and optionally - a source used to emit continuously into a specified field (such as the source_fuel_from_sphere1 Source Volume node).

Press the Play button and wait for a couple of frames. Then, middle-click on the Pyro Solver or any of the nodes below it and notice the different fields generated by this setup.

The Temperature field is used to ignite the Fuel. Later on, you can also use it for shading/rendering instead of the Heat field. Different people have different preferences and it is never a bad idea to experiment.

The Density field is the smoke produced during the burning process.

The Burn field is used to generate the Heat field. You can think of it as an intermediate step in the generation of fire and ignore it for the time being.

The Divergence field is used to calculate the expansion. High divergence is a property of explosions. Increasing the Gas Released (Pyro Solver → Combustion) to a high value will cause higher divergence. Unless you are going for a very custom setup, it's unlikely that you're going to need this field for shading/rendering.

The Pressure field is used for the Non-Divergent Projection. The Non-Divergent Projection alters the Velocity field in a way that removes areas which would cause volume loss. It is unlikely for this field to be needed for shading/rendering.

The Heat field is the actual 'flame', the representation of fire. Heat is created in those areas of the grid that have both Fuel and High Temperature. Temperature, on the other hand, does not depend on the presence or absence of Fuel. So, in simple terms, the most common way people shade/render Fire simulations is by specifying the Heat field as the 'fire' itself, and the Temperature field as the color modulator for the fire.

The Fuel field is the source of burning. Burning occurs when the temperature of a certain voxel is above the ignition temperature specified by the Pyro Solver.

The Velocity field carries the direction that the contents of the grid will be advected (moved) towards in the next frame or substep.

 

Houdini allows you to add additional fields to the DOP Simulation. One useful example of this would be a Cd / Color field that can be used to modulate the color of the smoke (Density) field.

Phoenix FD and the V-Ray Volume Grid allow you to load custom fields by remapping them to the internal channels (such as Smoke, Temperature, RGB, etc.), so we will look into a basic setup that takes advantage of this in Chapter 2 of this tutorial.

 


 

Let's look at the DOP Import Fields node. Go back up to /obj level and dive into the pyro_import node. Set the display flag to the DOP I/O import_pyrofields node.

The DOP I/O node is used to bring the fields from the DOP Simulation into the SOP level so you can tweak them or cache them to disk.

A very useful option of this node is the Compute Min/Max Values parameter. Enabling this checkbox will create 2 primitive attributes that hold the lowest and highest values at each frame for each field.

You can safely disable the checkboxes next to the Fuel, Rest and Rest2 fields to stop import as we're not going to use them. This will save you some hard drive space.

 

The typical ranges of Houdini and Phoenix FD Simulation cache files differ.

For instance, Phoenix FD is created with the intention of mimicking the real world as close as possible and thus, the Temperature is in Kelvin and the field can go as high as thousands of degrees. A typical Houdini Pyro simulation, on the other hand, has arbitrary Temperature values, usually between 0 and 50.

The Density field in Phoenix FD would usually be in the [ 0, 1 ] range, while Houdini's output would normally go higher.

 


 

Drop a Convert VDB node after the DOP I/O and set the Convert To option to VDB.

This will convert the native Houdini volumes to VDBs, which the V-Ray Volume Grid supports.

Verify that this is correctly set up by middle-clicking on the Convert VDB node. The VDB primitives should be listed in blue.

 


 

To cache the VDBs to disk, drop a ROP Output Driver and set the Frame Range and Output File parameters accordingly.

Make sure to set the Output File extension to .vdb.




Select Save to Disk on the ROP Output Driver and wait for the caching process to complete.


Importing in 3ds Max+VVG


To bring the VDBs into 3ds Max, go to Create → Geometry → VRay and select VRayVolumeGrid.

If you now click anywhere in the Viewport, a window should appear.

Navigate to the directory holding the VDB files, select any one of them and press Open.

You can also drag-and-drop the file into the viewport, which automatically creates the VDB.

 


 

Once you select the cache files and press Open, a window will pop up prompting you to select a preset.

Recall what was mentioned earlier - different software packages output different fields in different default ranges. These presets tweak the following parameters:

  1. If the Simulation is coming from Houdini or Maya, the Y/Z axis is flipped.
  2. The Houdini fields are remapped to their typical equivalents in Phoenix FD (Density → Smoke, etc)
  3. The Fire and Smoke rendering options are set up as a good starting point for further tweaking.

Select the Houdini Fire/Smoke preset.

 


 

Go to the Input rollout and click the "..." button → 3rd Party Channel Mappings.




The 3rd Party Channel Mappings window allows you to remap 3rd party fields to their corresponding Phoenix FD / V-Ray channels.

On the left are the Phoenix FD channels, and on the right - the fields found in the VDB file.

For example, the equivalent of Houdini's Density field is the Phoenix FD Smoke channel.

 

In the next chapter, we will take a look at outputting a color field from Houdini and remapping it to the Red, Green and Blue channels of the V-Ray Volume Grid.

As a side note, you can remap either the Heat or the Temperature field to the Phoenix FD Temperature channel. Both of those could produce a decent result after some tweaking so make sure to do some tests.

In this example, the Temperature channel is mapped to the cached temperature field.




Open the Preview rollout of the V-Ray Volume Grid and enable GPU Preview. The GPU Preview can be quite helpful during the shading process as most of the changes done to the Fire and Smoke opacity/color are displayed in the Viewport.

Head over to the Rendering rollout of the V-Ray Volume Grid and click the Volumetric Options button.

You can think of the window that pops up as the Phoenix FD volumetric shader. It provides options for both Fire and Smoke shading.

The V-Ray Volume Grid has an Auto Reduction option in the Preview which automatically degrades the Voxel Preview of the simulation.

Note that Auto Reduction does not affect the GPU Preview and enabling it with a very high-res simulation may cause significant lag in your viewport, or even outright freeze the 3ds Max interface.

You can manually reduce the quality of the GPU Viewport preview by increasing the Preview → Detail Reduction parameter.


Smoke Settings



First, open the Fire rollout and set the Based on option to Disabled. This will disable the rendering of Fire for both V-Ray and the 3ds Max Viewport and allow you to focus exclusively on the Smoke.

Open the Smoke Opacity rollout in the Volumetric Options window and set the Based on parameter to Smoke.

The Smoke option allows you to edit the Opacity Curve for the smoke manually. You should use this if your setup requires greater control over the Smoke channel.

The Simple Smoke setting, on the other hand, takes care of the opacity curve using an internal algorithm - you don't need to alter the curve but instead, you can just tweak the Simple Smoke Opacity value.

Select the Right point of the curve in the Opacity diagram and use the numeric field at the bottom to set its X value to 8. Feel free to tweak the Opacity curve as you see fit. With the GPU Preview enabled, any changes will be properly displayed in the Viewport.

Depending on the look of the smoke, you may want to consider enabling the Scale Opacity by Scene Units option. This will cause the smoke to appear either sparser or denser based on the scene units of your 3ds Max scene.

 

Note the green strip covering parts of the grey background of the ramp. The green represents the range of the selected channel. Recall that the Density field of the Houdini simulation was in the range of 0 to 8 or so, and when the VDB files were remapped from the 3rd Party Channel Mappings menu of the V-Ray Volume Grid, the Density field was specified as the Smoke channel.

Thus, the range of the Smoke channel is now approximately from 0 to 8.




To quickly check the range of all loaded channels, open the Frame Info rollout.

The values shown in the Cache File Content window are exactly the same as the primitive attribute Min/Max values for each field in Houdini's Geometry Spreadsheet.

 

 





Fire Settings


 

Next, let's work with the Fire.

Open the Smoke Color rollout and set the Based on to Disabled. This will disable the preview of Smoke in the 3ds Max Viewport and allow us to focus exclusively on the Fire.

Open the Fire rollout and set the Based on to Temperature. For a detailed explanation of all the parameters in the Fire rollout, please check the Fire Rollout Documentation.

Note the green strip overlayed over the gray background of the ramp. Just as it was with the Smoke channel, this strip represents the range of the Temperature channel (that is the Houdini Temperature field remapped to the V-Ray Volume Grid Temperature channel).

You can tweak the Color, Intensity, and Opacity of the fire, and those changes will be treated differently depending on the Fire Opacity Mode chosen.

Experiment with different settings to find the best result. In this example, the settings in the image to the right are used for the final render.

We have placed a lot of different colors on the color ramp because of the Houdini Temperature field being too uniform, but that is to be expected when the simulation is so simple. Far less adjusting would be required if you were to put some extra effort into the simulation setup (i.e. tweaking the source geometry, the source velocity field, and all settings in the Pyro Solver's Shape rollout) rather than using a default Fireball preset.

 



If the Fire Opacity Mode is set to Fully Visible, V-Ray will prompt you with a message saying that this setting will not work correctly with Probabilistic Shading.

To disable probabilistic shading for the V-Ray Volume Grid, press the 8 key to open the Environment and Effects window. Scroll down to the Atmosphere rollout and select the VRay Volume Grid in the list.

A new rollout called VRayVolumeGrid Atmosphere Settings should appear below. Disable the Use Probabilistic Shading option.










Open the Smoke Color rollout. Using the Based on parameter, you can choose a channel to base the Smoke color on. Temperature and Smoke are both reasonable options. In Chapter 2, we go over using a custom Cd channel exported from Houdini to use as the Smoke Based on RGB option.

Note the values on the left and right-hand side of the color gradient - those are the ranges of the channel chosen for the Based on parameter. In this setup, Smoke is chosen as the Smoke Color field, and the gradient is tweaked such that the sparse areas (close to 0) of the smoke are black and the dense (close to 7) are white.

The values to the right are used in the final render for this example.