Instance color
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. You can then assign colors 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.
Figure 1: Instance color Node
For the example below, there are 10x10 instances, and since a Lua script assigns IDs to each instance, OctaneRender generates 100 IDs.
Figure 2: A cube and 99 instances of the same cube are shown here, forming a 10x10 grid of cubes
You can plug an image with 10x10 pixels into the Instance Color texture to match these dimensions. OctaneRender maps each pixel and assigns them to the instance IDs.
Figure 3: 10x10 grid with four colors
You can also use an existing image's dimensions as the basis for creating the instances. You can create the instances and assign an ID to each instance by a Lua script, or by an OctaneRender plugin, or any other standard object scatter plugins supported by OctaneRender®.
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 you can specify more than one color per instance.
Parameters
- Power - Power/brightness.
- Color space - Set image color space.
- Legacy gamma - Gamma value. Only used when the color space is set to "Linear sRGB + legacy gamma".
- Invert - Invert color.
- Linear sRGB invert - Invert image after conversion to the linear sRGB color space, not before.