I am trying to create a node material that can function like a color scale that will set a meshes color from a predefined gradient based on a input. Ideally this input value is read in from the meshes metadata, similarly to how you can use the meshes position as an input value. Is this possible?
I understand how to access the metadata information from a mesh generally, what I am struggling with is applying it in the context of a node material that can dynamically read the metadata from the meshes it is applied too.
For example if i have 3 spheres that I apply the same node material to, the node material will get the input value from each spheres metadata property and set the gradient step accordingly.
This is just illustrative example - https://playground.babylonjs.com/#44N2I0#10
3 meshes use the same NME materials but with different values. In this example they depend on time, but there is no problem to make these input values to depend on mesh.metadata.
In this case it is even simpler like here - https://playground.babylonjs.com/#44N2I0#14
Yep! more or less what I was going for thank you! I was hoping to avoid cloning the material and using more than one material per mesh but it looks like that is not practical.