Houdini 12 Copying and instancing

Overview

Instancing replaces an object with another at render time. This lets you, for example, use lightweight proxy geometry from the 3D display, and swap it efficiently for more heavyweight, detailed geometry at render time.

Point instancing replaces the points of an object with other objects at render time. This makes it easy to create a large number of efficient copies of an object. For example, scatter points on a surface representing a meadow, and replace them in the render with trees.

Because instancing takes place in the renderer, the instanced geometry does not use memory or slow down the display as you work in Houdini. On the other hand, since you can’t see the instanced geometry in the viewport, it might be hard to visualize the finished scene.

Point instancing is very similar to particle instancing.

Tip

Using the delayed load shader lets you store the geometry to instance on disk rather than in the scene.

How to

  1. In the network editor, create an Instance object at the object level.

  2. In the object’s parameters, click the Instance tab and set the Instance object parameter to the path of the object you want to instance onto the points of the Instance object. (You can drag the node from the network onto the parameter to set it.) Turn on Point instancing to instance onto the points of the Instance object instead of replacing the Instance object.

  3. Go inside the Instance object and model the template geometry. The object you set above to instance will be copied onto the points of this geometry at render time.

(See how to use the network editor if you need help working with the network and the parameter editor.)

Tip

The Instance object is just a regular Geometry container object with some extra render properties related to instancing added to it. You could manually turn any object into an instancing object by adding the same properties (in the parameter editor, Gear menu > Edit rendering parameters, open Mantra x.x folder, and drag the Instance folder into the Existing parameters list). However, it’s usually more convenient to start with the Instance object.

How it works

You can only instance object-level nodes using point instancing: geometry container objects, lights, cameras, object subnets, object-level digital assets, and so on.

You can vary object-level parameters for each instance, such as transforms. You can also override material parameters per-instance, which can be very powerful. Instances can also pick up various attributes from the points they are instanced onto. See varying copies and instances for more information.

Instancing is fast and efficient because the renderer only needs to keep one copy of the object’s geometry, and just output it multiple times for each instance. This means that the object’s actual surface geometry cannot changed between instances.

For example, you could have a skyscraper object asset with a parameter that changed the surface network inside to vary the number of floors. You could not instance the object with varying number of floors, because the renderer keeps one copy of the object’s geometry for instancing. To do instancing with varying geometry, you would have to do one of the following:

  • Save out archives of each geometry variation, then use a delayed load shader and a point attribute or expression to control which variation is instanced onto the point. See delayed load instancing.

  • If possible, change the asset so its variation works at the object level instead of the geometry level (for example, a skyscraper asset where each part is an object).