Houdini Instancing - Octane Materials & Attributes

Note: This is the current workflow for Houdini 19.5.605 and Octane 2022.1.1. This may change in future releases.

overview

Geometry instancing allows you to reference the values/attributes of one model, and “duplicate” the asset with far less overhead, allowing for scenes with millions to billions of polygons, capable of being rendered on a consumer GPU. This of course comes with limitations and caveats.

For a holistic guide on instancing, Toadstorm has a brilliant write up:

An Even Longer-Winded Guide to Instancing in Houdini

accessing attributes for non instanced materials

Of course if you have a small scale scene, you could simply keep the geometry live, and your attributes will work without issue. With heavy scenes this becomes unwieldly fast, but for everything else, it should do the trick.

This example scene is basic, a grid of points with two random attributes, one vector, one float. A material is added after the copy to points. Note your attributes and primitive count, this is live geometry.

To tell Octane to prepare your attributes for use in your material, jump back to the OBJ context, and check your octane settings. Under Attributes, you should enter all you wish to use. For this example I’ll just be using the Cd attribute. Note: Attributes must be from points or vertices. Primitive and detail attributes will need to be promoted.

Next create your material, and add the color vertex attribute node. Enter your desired attribute and voilà! We now have the random color from the source points applied to our material. To do this with packed primitives, however, requires another method.

the instancing shader trick

At this time Octane does not support custom attributes on instances, but there is a way around this.

First ensure that you are converting your mesh into packed primitives, and enable “Packed Geo Instancing” in your OBJ octane settings. Confirm this by checking your data stream, and ensuring octane is not unpacking your primitives at render time.

You will also need to ensure your material is added before your copy to points, on the mesh itself.

Now for the material, you’ll need one or both of these files, included in your octane plugin installation:

rgb4k_map.ppm

alpha4k_map.ppm

In my case these were found here, but your path may differ:

C:\Users\[USER]\Documents\houdini19.5\Octane_2022.1.1.1_Houdini_19.5.605\tex

These texture assets will reference your Cd or alpha attributes. To use them, add a Texture Instance Color node, and add the file path. And that’s it! Same attributes as before, now applied on instances via a single material.

With some creativity, the color vector can be used as three float attributes, giving you a total of four.

Ideally custom attributes are supported better in future releases, but in the meantime, this should help give you shader variation without wasting too many resources.

Thanks for reading!