# Nodematerial vs custom material

**URL:** <https://forum.babylonjs.com/t/nodematerial-vs-custom-material/14107>\
**Category:** Questions\
**Created:** [September 12, 2020, 6:50am UTC](https://forum.babylonjs.com/t/nodematerial-vs-custom-material/14107 "2020-09-12T06:50:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 12, 2020, 6:50am UTC](https://forum.babylonjs.com/t/nodematerial-vs-custom-material/14107/1 "2020-09-12T06:50:57Z")

</div>

hi all ! I’m trying to convert the VAT generator in this pg: [Babylon.js Playground](https://www.babylonjs-playground.com/#T2QE5X) to one that uses custom material: [https://www.babylonjs-playground.com/#T2QE5X#1](https://www.babylonjs-playground.com/#T2QE5X#1)

I’m getting weird errors. uv2 is needed to read the VAT, I should not have to define it manually. How can I enable uv2 such that the shader will automatically access the mesh’s vertexBuffer.UV2Kind data ?  
The error in Chrome console is: Error: VERTEX SHADER ERROR: 0:197: ‘uv2’ : undeclared identifier

If I do declare uv2 explciity in Vertex\_Begin, I’m not getting any movement in the instances. Or am I going about this wrong, customMaterial and nodeMaterial are not 1:1 compatible ?

---

<div class="post-metadata">

**Author:** ![Raggar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raggar/32/20672_2.png) [@Raggar](https://forum.babylonjs.com/u/Raggar)\
**Post date:** [September 12, 2020, 9:26am UTC](https://forum.babylonjs.com/t/nodematerial-vs-custom-material/14107/2 "2020-09-12T09:26:07Z")

</div>

[https://www.babylonjs-playground.com/#T2QE5X#2](https://www.babylonjs-playground.com/#T2QE5X#2)

```
sb_mat.AddAttribute('uv');
sb_mat.AddAttribute('uv2');

sb_mat.Vertex_Definitions(
     'attribute vec2 uv;'
    +'attribute vec2 uv2;'
)
```

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 12, 2020, 10:36am UTC](https://forum.babylonjs.com/t/nodematerial-vs-custom-material/14107/3 "2020-09-12T10:36:38Z")

</div>

Thank you ! I knew I was missing something obvious…

fyi: the perf at 60hz looks better than the nodeMaterial’s at 60hz…
