Hi all,
I’m generatin a custom mesh made by several rectangular faces.
In order to be more efficient and create a manifold object, I need to share the vertices between adjacent faces inside the custom mesh.
Problem is, in this way if I use vertex colors, I cannot have 2 adjacent faces of different colors.
For example, see this oversimplified model with 2 rectangular faces:
My goal would be to have the left face colored in red and the right in yellow (see the image below), but of course in the Playground I could only set two vertices in red, while the other four are yellow because there are two shared vertices between the two faces.
I managed to modify the NME in order to support 4 colors, but this is pretty “static”, in the sense that I have 4 constant colors and 4 greater-equal conditions hard-coded in the NME definition:
Is it possible to pass a vector of N colors and N “thresholds” on y-axis (i.e. where the color should change), possibly through a mesh attribute or something parametrized outside the NME ?
Sorry for the probably silly question but I’m a little confused about how NME works…
This might be able to help Babylon.js docs and if not we might need to add some of the missing docs. @Deltakosh will be back on Monday with a better answer
I think I grasped the basic concept of your suggestion but I’m not capable of implementing it in the NME (I’m really really bad with visual programming languages ).
If you could provide a really small example, that would be great, but no worries if you don’t have the time.
For my use case, every time the palette/model changes, I think that I can try to generate and build a new node-material with the N colors and N conditions
Thanks again, your first example has been very useful.