The problem with instances and nodeMaterial (load from NME json)


I’m using containers to load GLTF/GLB files. After loading, I create instances (since they are prefabs), and everything works fine. But when I try to load NodeMaterial, everything breaks. The camera zooms in, and the material is displayed only on one of the instances. I’ve tried different materials and not animated ones. It might be a bug, but I’m not sure. Maybe I’m doing something wrong?

Does not work with NodeMaterial:

Works with PBRMaterial:

I will be glad of any help. If it’s a bug, I can look deeper.

You must use the Instances block in your node material if you want to support instances:

1 Like

Thank you very much for your prompt response and assistance.

It appears that the solution you’ve provided may not suit my needs, as I had intended to specifically just a JSON file from the Node Material Editor. Our plan was for our designer to upload shaders via FTP to our server, after which we would integrate them into our systems using tags for instances within containers. The shader link I mentioned was taken as an example from the Babylon documentation. Perhaps you might have some additional ideas on how to implement this?

You can generate a .json file from the NME by hitting the “Save” button:


Yes, I know, that’s what I do, I save the file from NME. But as you can see from the example at the beginning of the topic, the JSON loaded into NodeMaterial doesn’t work with container instances.

I can try to rephrase my question:

Can a loaded shader (taken from the Node Material Editor in json format) work with LoadAssetContainer instances?

Is it a bug?

But your json needs to contain the blocks to support instances which is not the case here as Alexis mentioned.

You need to modify your materials before exporting them to JSON as he stated above.

Thanks for the previous entry! That was really helpful!
But, I have one more question regarding the topic:
When I’m using Instances block in NME, does its output replace World (matrix) for all other blocks (like World Normal and World Target etc.)?
Shortly, does this setup look correct?

Yes, you should connect the Instances.output output everywhere a block expects a world matrix: it should completely replace the regular world matrix.

Got it! Thank you!