Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Image Added

If you have geometry in your scene that is reused in multiple places, instancing provides you with the ability to reduce the memory footprint of your renders if you do a little bit of extra work.  For example, if your scene is composed of multiple buildings, each rotated a bit differently, you can use instancing to only load one copy into memory.

RenderMan for Katana supports three approaches to instancing: leaf-level instancing, hierarchical instancing, and instance arrays.  The first approach lets you instance matching pieces of geometry via an attribute.  The second and third are very deliberate approaches where you set up an object master and then explicitly instance it. The teapots_instancingExample.katana file includes an example of how to render the above image using these methods.

Leaf-level instancing

You may find that your scene is taking a lot of memory, and you think that because your scene has lots of repeated geometry, that you may be able to take advantage of instancing.  The leaf-level instancing approach can be used to efficiently turn already existing geometry locations into instances of each other via the instance.ID attribute.  RenderMan for Katana will make the first location it encounters with a certain instance.ID into the geometry master, and all subsequent locations will be instances.  All locations with matching instance.IDs must be identical, otherwise there could be undefined behavior depending on which location RenderMan for Katana encounters first. The screenshot below shows an example of how to set the instance.ID attribute via an AttributeSet node.

...