Skip to content

Instance Color#

Instance Color texture allows you to control independently the color (or any other shading attribute) of object instances contained in a Scatterer or a Combiner.

It associates an instance to the corresponding point from the point cloud that was used by the scatterer or the combiner to compute the position of objects. It can then be used by another texture that is able to compute a projection from the position of the point (eg: a spatial texture) or by a Support Color texture that is able to evaluate the support geometry of the point cloud.

Typical setup of the Instance Color texture

Typical setup of the Instance Color texture

Note

If the object is not instantiated, the instance color texture returns a black color. This is why it is generally used before a blend node, so that the shader can still be used for non scattered objects.

Clarisse instancing/scattering system is hierarchical. Indeed, you can have a scatterer scattering another scatterer and so on. Using Parent Level attribute, you specify the hierarchical level of your instance. For its texture, the Instance Color will then use coordinates supported by the correct point cloud.

figure 1

figure 1

figure 2

figure 2

figure 4 figure 4

A single leaf (figure 1) scattered on a tree (figure 2). Each leaf receives a different color. Colors are based on the texture (figure 4) mapped using the texture coordinates of the point cloud used to scatter the leaves on the tree.

figure 5

figure 5

The resulting tree is then scattered on a grid. You can see the same pattern which is repeated on each tree. This is because the Parent Level of the instance color texture is set to 1. It then uses the same texture coordinates as shown in figure 2 to drive the color of each leaf.

figure 6

figure 6

The same setup, but now with Parent Level set to 3. The texture coordinates are now extracted from the array point cloud (level 2 being the combiner containing each tree).

Thanks to the hierarchical scattering system, you can get infinite variations using this powerful texture node. For example you can draw patterns on crowds or create very realistic cities using instance color texture to switch different versions of same assets controlled by a drawn texture map. The possibilities are endless. Here is an example using the Instance Color texture on a forest:

The ground support object (shaded)

The ground support object shaded

The texture map applied to the ground used to check the texture coordinates

The texture map applied to the ground used to check the texture coordinates

The same texture map connected to the instance color texture used on the leaf material

The same texture map connected to the instance color texture used on the leaf material

Same render using the figure 4 texture

Same render using the figure 4 texture

Final shot

Final shot

It is also possible to use the Parent Level attribute to locate a specific object in reversed order using negative values. When set to -1, the node returns the information of the top most combiner or scatterer that owns the instance.

For example, let's imagine that a sphere is inside a combiner B that is itself inside a combiner A:

  • 0 will evaluate on the sphere
  • -1 will evaluate on the combiner A
  • -2 will evaluate on the combiner B