I wanted to follow one of the tutorials (YouTube - Node-Based Procedural Textures) that you have and all work nice up to some point.
So this is working PG:
All works nicely when NodeMaterial is used as a snippet and loaded from here:
So the default PB as it is.
When I “generate code” from that snippet and use this as my nodeMaterial:
Switch if in line 96 to false:
I got this error in a Console:
I started to investigate this and it’s this mode selector in NME:
But this option is not passed with Generated Code. When I use Inspector in my PG I got that my NodeMaterial is normal default Material and all my nodes from snippet are reset to default settings of NodeMaterial Procedural:
Alsoe this code that I found:
I tried to use it here at the beginning of my PG but its also not doing much:
The mode is read-only so I was thinking this method will set my NodeMaterial editor mode to Procedural, and code after that will be used as desired creating procedural mode NodeMaterial but no.
When you uncomment this line it creates something even weirder. It has my all nodes plus default nodes from NME new material. I got double Vertex output and double FragmentOutput after that. And of course, it’s not working:
I really do not get it. How to make this code run from Generated Code.
I’m using BabylonJS 4.2 but the result is the same as in Playground.