Nodematerial vs custom material

hi all ! I’m trying to convert the VAT generator in this pg: Babylon.js Playground to one that uses custom material:

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 ?


     'attribute vec2 uv;'
    +'attribute vec2 uv2;'

Thank you ! I knew I was missing something obvious…

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

1 Like