---
title: "Instances"
canonical: "https://rmanwiki-26.pixar.com/space/RFB26/321945602/Instances"
format: markdown
---
![Rfb_Instancing.png](media://a84058bc-2441-4e74-a0f4-066ed2bc15b5)

RfB should support most workflows with regards to instancing in Blender.

Instancing children onto the vertices or faces of a mesh is one such workflow RenderMan supports.

In the image below, we have instanced a single locker onto the vertices of the plane geometry.

![RenderManBlender_VertexInstancing.jpg](media://34d9ba8d-989d-4ebd-a2c8-e4411b43e037)

For further control, you can also use the Collection Instancing (Shift A) workflow in Blender, as seen in the example below.

![RenderManBlender_Collectionnstancing.jpg](media://3d4379c8-58d7-437d-b956-693e37e5d547)

RenderMan also supports mesh and collection instancing via Blender’s Geometry Nodes.  In the example below we are instancing the Locker Collection along a line using a simple Geometry Nodes setup.

![RenderManBlender_GeometryNodes.jpg](media://e403faa0-59b7-44f4-8f62-2ba8f8b98554)

---

## Shading Variation

Nothing in the real world looks identical, so why should our instanced lockers?  

Let’s start by taking a look at the Lama shading setup we’ve used on the locker.  It is created using a number of a number of layers.

### Layer 1. Base Metal - LamaConductor

The base material is a LamaConductor with the IOR set to Aluminium.

### Layer 2. Paint - LamaDiffuse + LamaDielectric

To create the paint on top of the metal locker, we have a LamaDiffuse setup that provides the base color.  Over the LamaDiffuse, we add a LamaDielectric layer to add Specular Roughness.

This paint layer is then layered over the top of the base metal using an edge mask setup, which adds edge breakup and scratches to show the base metal layer underneath.

### Layer 3. Dirt - LamaDiffuse

A layer of dirt is added over the top of our locker, provided by a simple dirt-colored LamaDiffuse node and controlled using a PxrDirt node to add the dirt into the occluded areas of the locker.

![RenderManBlender_Locker_LamaMaterial.jpg](media://e18303be-cc7d-404b-839d-f7298eba602a)

But, what about if we want each locker to be a different color?

Well, that’s easy!

The power lies in the PxrVary node.   

In the example below, we have connected a PxrVary node to the input color of a PxrHSL node (which provided the original red base color).

To demonstrate the material variation, the hue value of the PxrVary has been pushed to demonstrate the effect that the PxrVary is having.  

![RenderManBlender_Locker_LamaMaterial_PxrVary.jpg](media://948dcdb6-4024-4cd6-a2b6-08ec16648404)

They look pretty funky, but in reality, each locker would have a similar base color but with a touch of color variation.  Imagine that each locker started life the same color (as they were all painted from the same paint tin!), but over time, some have faded in the sun, whilst some have been repainted.

The example below sets the base red color via the Hue parameter and then subtly adjusts the saturation, luminance, and gamma of each instance.  It’s a subtle difference in each locker, but that’s what we want.

![RenderManBlender_Locker_LamaMaterial_PxrVary2.jpg](media://a79ab1ad-df7a-4d5b-8404-c4a13e060668)

To push this locker shader even further, those with keen eyes will notice that each of the lockers has different edge breakups, stains, and roughness.  

Not only is the variation of the base red color of the locker randomized by the PxrVary, but the placement of all of the textures used is also randomized using the Randomise parameters inside of the PxrRoundCube nodes.

![RenderManBlender_Locker_LamaMaterial_PxrVary3.jpg](media://76834995-b244-46e6-8cf2-ed6bb2b8e438)

Knowing this, go forth and have creative fun with the instancing in RfB … go The Redwood Wildcats!