The Instance Color texture holds an image, and prepares each image pixel to map to geometric instance IDs. Just as a Lua script or any of the OctaneRender® plugins can generate object instances, these same processes can assign IDs to each of the instances generated, which results in a grid of instance IDs. Colors can then be assigned to each instance ID via a texture node (in this case with an image in the Instance Color texture), and match the IDs with pixels of the image, starting at the bottom-left and moving up to the top-right.


For the example below, there are 10x10 instances, and since a Lua script assigns IDs to each instance, OctaneRender generates 100 IDs (figure 1).



10x10 Grid of Instanced Cubes



Figure 1: A cube with 99 instances 

 

An image with 10x10 pixels is plugged into the Instance Color texture to match these dimensions. OctaneRender maps each pixel and assigns them to the instance IDs (figure 2).



Color Texture



Figure 2: 10x10 grid with four colors



Nodegraph Layout



Figure 3: The Nodegraph layout for Figure 2

 

In figure 4, a more complex image is used as the texture to be distribnuted across the instances. 



Instanced Color



Figure 4: Instance Color example with defined IDs

 

Since OctaneRender stores the colors as a texture, this option is more flexible compared to storing the colors with the geometry, since more than one color can be stored per instance.