Houdini 20.0 Pyro

Advanced pyro instancing

On this page

Note

This workflow guide uses special terms like spawn points or packed sets. If you're not familiar with this terminology, please go to the Pyro instancing definitions page for more information.

With the help of the new Pyro Spawn Sources and Pyro Source Instance nodes you can achieve full control over the pyro instances and their attributes.

The Pyro Spawn Sources node creates spawn points. You can connect a point source, e.g. a scatter or a curve, or let the node create a single point at the origin (which can be moved and rotated freely using the Transform SOP). Spawn points identify which packed set will be used and store basic animation parameters like Start Frame and Source Speed. At each frame, a spawn point may generate a single instance point. The spawn points can be set to loop, in which case they will birth new instance points at different times during the simulation.

The node’s parameter values are stored on point attributes of spawn points. These properties on attributes can be modified to control the instances, e.g. through a downstream Attribute Adjust Float node. You can see the available attribute names (name, startframe, etc.) when you hover the mouse over a parameter to get its tooltip. Aside from the parameters, there are also P, pivot, and orient attributes that control placement of the instance. You can merge spawn points from multiple Pyro Spawn Sources SOPs if you want to modify them together or before conversion to instance points.

The spawn points are then fed to a Pyro Source Instance operator. When a spawn point activates, this node creates an instance point. The instance points, on the other hand, are fed to the Pyro Solver. The Pyro Source Instance node can register rule overrides for the point attributes. It is, for example, possible to scale temperature within a random minimum-maximum range and create hotter and cooler sources.

Below you find a step-by-step guide for the creation of an advanced pyro instancing setup. As in the basic pyro instancing workflow, everything starts with a source library.

Creating the library

The library contains all sources. A source can be a preconfigured tool or a custom network. The common basis is that each source has to be wired to a Pyro Source Pack. This node creates a packed source and contains the rules for the volumes, e.g. density and temperature.

Let’s say you have three sources with different shapes (torus, box, sphere), based on the Pyro Configure Billowy Smoke tool. The network chains are connected to individual Pyro Source Packs, named torus_smoke, sphere_smoke and box_smoke. As shown below, these packed source sets are then merged into a LIBRARY with a Merge node.

Note

If you're not sure how to create the library’s smoke sources, please follow the steps in the Packed source sets library section of the previous chapter. The setup there can be used for this workflow.

Note

You can keep the original Pyro Solver that comes with the Pyro Configure Billowy Smoke tool. Or you create a new solver later.

  • Add a downstream Cache node to the LIBRARY. The Cache saves the results if a certain frame was already encountered. Instead of recooking the library, the Pyro Solver can pull the appropriate frame from the cache when it’s needed again. This will speed up the simulation, especially with expensive source setups.

Creating the Pyro Spawn Sources

There are three packed sources inside the LIBRARY, so you need at least three Pyro Spawn Sources nodes if you want to use each element. If you want to use a packed source multiple times, e.g. with rule overrides, you need one more Pyro Spawn Sources node per changed source.

  1. Create a Grid node. The grid defines the area where the sources are scattered.

  2. Add one Scatter node per packed source - here you need three Scatter operators.

  3. Connect the Grid’s output to the inputs of the Scatter nodes.

  4. For the different Force Total Count parameters enter 5, 3 and 4.

  5. Add three Pyro Spawn Sources nodes and wire their inputs to the outputs of the Scatter nodes.

  6. For the Source Name parameters, enter torus_smoke, sphere_smoke and box_smoke - names of the packed source sets.

  7. Add a Merge node, and connect it with the outputs of the Pyro Spawn Source nodes.

Creating the Pyro Source Instance

Up to this point, the setup creates the spawn points with all attributes. When the simulation reaches the Start Frame, the source is activated. To create the associated instance points, do the following.

  1. Add a downstream Pyro Source Instance node.

  2. Connect the Merge node’s output to the first input.

  3. Wire the LIBRARY node’s output to the second input.

  4. If there’s no Pyro Solver, create one and customize it to your liking. Otherwise, use the existing solver operator. Connect the solver’s first input to the Pyro Source Instance node’s output.

The result so far could look similar to the video below.

Adjusting and randomizing attributes

As shown in the video above, smoke emission stops after a few frames. This happens because each spawn point is set to advance through its packed set’s animation range at normal speed. Once this frame range is exhausted (and it’s set to frames 1-12 by default on the Pyro Source Pack SOP), the sourcing stops. For explosions or fireballs, a limited range is desirable, but for smoke you might want to have continuous emission over the entire frame range.

Another detail of the above simulation is that sources of the same type all start at once.

Providing control over a wide variety of attributes is one of the big advantages of spawn points. You can see spawn points as a recipe for instancing sources: you set the conditions in the form of attributes. With startframe and endframe you tell the solver when to apply this recipe. This doesn’t necessarily mean that sourcing happens within the given frame range, but it can not happen outside that range.

The sourcing begins on startframe using the startoffset as the offset. For each frame advanced beyond startframe, frame offset of the instance point is increased by sourcespeed. To get continuous emission, we can apply one of the following changes.

  • Select the Pyro Spawn Sources nodes and set the Source Speed to 0. This will use the exact same geometry for sourcing on all simulation frames.

  • Instead of adjusting Source Speed, enable Loop Length. This will repeat the same sequence (of the given length) for sourcing purposes. Unlike setting Source Speed to 0, this approach will still use a different frame of the packed source set for each simulation frame.

To randomize startframe follow these steps.

  1. Add three Attribute Adjust Float nodes - one for each Pyro Spawn Source.

  2. Insert the new nodes between Pyro Spawn Sources and the Merge.

  3. Select all Attribute Adjust Float nodes.

  4. Under Attribute Name enter startframe.

  5. From the Pattern Type dropdown, choose Random.

  6. Set Range Values to Min/Max.

  7. Define values for Min Value and Max Value, for example 1 and 25.

  8. Enter a different Seed value for each Attribute Adjust Float.

The new setup, but with different Frame Range and startframe values:

Rule overrides

With rule overrides you can manipulate the packed source’s merging operations. A good example is scale of density, which affects transparency of injected smoke. The following steps will adjust the rules to make smoke added by sphere_smoke very thick, while making box_smoke barely visible.

  1. Go to the Pyro Solver’s Look tab and set Smoke ▸ Density to 1. This is not mandatory, but provides better visibility.

  2. On the Pyro Spawn Sources node for sphere_smoke, click the button by Rule Overrides.

  3. Set Target Field to density.

  4. Set Property to Scale. Effective smoke density during sourcing will now be scaled by the value of Multiplier.

  5. Set Multiplier to 10.

  6. Repeat the above steps on the Pyro Spawn Sources node for box_smoke. Set its Multiplier to 0.1.

Note that we did not touch rules embedded on the packed source sets, but individually adjusted them before their transfer to the instance points. This is the intended approach to tweaking merging operations, for the library should be treated as immutable during instancing.

By interfacing with rule overrides on Pyro Spawn Sources in the example setup, we ensured that all instances of the same type are identical. You can also register overrides on the Pyro Source Instance SOP that are driven by point attributes. This method allows you to quickly introduce random variations among instances.

  1. In the Pyro Source Instance node, go to Overrides and click to add a new rule.

  2. For Target Field enter temperature.

  3. Set Property to Scale.

  4. Under Attribute, enter temperature_scale.

  5. Click the icon to create an upstream Attribute Adjust Float node, named adjust_temperature_scale.

  6. Select the new Attribute Adjust Float.

  7. For Min Value, enter 0 and for Max Value, enter 4.

When you simulate, you can see that the smoke puffs rise at different rates.

Pyro

Sparse Pyro

Pyro instancing

Legacy Pyro