Unfortunatelly i dont understand whats happend because i dont find detailed documentation about the way of creation custom block which you used in your example. Never the less I looked at doc about creation of the custom blocks from json file (Node Material Editor Custom Blocks | Babylon.js Documentation). But I dont understand how i can define attribute (my custom buffer) and provide them on output of the node using way this way (Node Material Editor Custom Blocks | Babylon.js Documentation)
In fact, when in the NME, the default setting is to generate the comments along with the functions that have been injected in the code through the _emitFunction method. The comment is the 3rd parameter of _emitFunction, but in my example I did not set a comment, so it is undefined my default. You can fix the problem by setting a dummy comment:
One more question. Could I add such as custom block to NodeMaterial editor? I know how to do that with blocks parsed from .json but in this case I donât know if it is possible
I dont think that it is right to open another topic because my new question is very close to this topic. It is about providing of texture to node material by instance. I already read topic about changing texture per instance using uv offset but it will not work for me. Maybe there is the way to provide small texture (<512x512 px) using buffer? Like we did it with floats or vectors
Unfortunately itâs not possible. We canât bind textures on a per-instance basis. You will have to use a big texture and pass a (u,v,width,height) vec4 to each instance, so that they can each target a different part of the texture.