Heya I’m trying to use NME to make a material for a mesh with thin instances, but can’t get the color attribute to work.
Here’s a simple NME that uses the instances block and color attribute for example: NME Material
It works well with instances like here: Instances PG
But with thin instances, they’re drawn black like here: Thin Instances PG
The PG’s are simple ones from the documentation with just the material changed to the above NME material. And if you comment out lines 47 and 48 on the Thin Instances PG you can see the color attribute working with the default material.
Not sure if it worked before or if it’s even something that’s supposed to work? Or if not maybe there’s a workaround?
PS I tried changing the attribute kind from “color” to “instanceColor” in case it’s related to that recent change but it didn’t help.
So I did find a (temp ) workaround from this demo of custom attributes, although it’s not as conventient since the connections to other blocks must be made in code rather than just using NME.
So I did just find a simpler fix at least. Running the below code after loading the NME material seems to work to make the material compatible with the new thin instance attribute “instanceColor”.
I just did a quick search for “daggerMagicActive” to find all the forks (7 total)
All are the same, except that this one. It gets passed the loading screen, although doesn’t work. It’s probably someone’s failed experiment, but could be useful to compare for debugging. Note: this is not the one that used to work!!
.https://playground.babylonjs.com/#XZK9RB#0
Ok got the one for the god of war demo and it is related to some of our latest tangents changes moving from vec3 to vec4. I ll push a back compat fix for it tomorrow with the instanceColor one
I tried the test build for the PR but couldn’t get it working (tried changing the name from “color” to
“instanceColor” but didn’t help). It looks like the changes to serialization are for the other issue so saving from the live NME with the old serialization code should work for testing the color fix right? Thanks!