How to set custom attribute on ShaderMaterial for use with instances and clones at the same time?

It’s a little convoluted because you must pass an object that has either a toArray or copyToArray method for the value when doing mesh.instancedBuffer["num"] = value, and obviously the float type does not have any of these methods:

https://playground.babylonjs.com/#026IT4#3

1 Like