# Node material instance U, V offset and color?

**URL:** <https://forum.babylonjs.com/t/node-material-instance-u-v-offset-and-color/40783>\
**Category:** Questions\
**Tags:** material, nme, instances, nodematerial\
**Created:** [May 14, 2023, 6:22am UTC](https://forum.babylonjs.com/t/node-material-instance-u-v-offset-and-color/40783 "2023-05-14T06:22:36Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [May 16, 2023, 10:05am UTC](https://forum.babylonjs.com/t/node-material-instance-u-v-offset-and-color/40783/9 "2023-05-16T10:05:24Z")

</div>

`instanceColor` is actually the instance color, and `color` is the vertex color.

The reason `color` works as an instance color in the example is that the vertex color buffer is created with a `registerInstancedBuffer("color", 4);` call, which creates an instance buffer for “color”. Before `instanceColor` existed (feb 2022), this was the only way to have a per-instance color, and it was not possible to have an instance color + a vertex color at the same time.

To make the instance color work with thin instances, you have to use the `instanceColor` attribute, because `thinInstanceRegisterAttribute("color", 4)` will actually be translated to `thinInstanceRegisterAttribute("instanceColor", 4)` (we did this to retain backward compatibility). So, overall, `instanceColor` should always be used when you want to use a per-instance color, and you should register the buffer by calling `registerInstancedBuffer("instanceColor", 4);` / `thinInstanceRegisterAttribute("instanceColor", 4)`.

Here is an example that shows how to create a custom attribute for use in the NME:

> [@Using shaders exported from Node Material Editor](https://forum.babylonjs.com/t/using-shaders-exported-from-node-material-editor/15628/5):
>
> You can also inject a new attribute in a node material by using the same technic than described here: [Thin instances, node material and custom attribute](https://forum.babylonjs.com/t/thin-instances-node-material-and-custom-attribute/11110)[https://playground.babylonjs.com/#NICGSS#10](https://playground.babylonjs.com/#NICGSS#10)

---

_[View the full topic](https://forum.babylonjs.com/t/node-material-instance-u-v-offset-and-color/40783)._
