I’ve been following a bunch of the NME tutorial videos on the Babylon youtube channel, they’re great!
I’m trying to get the color of my models (loaded from a glb file) to use as input into my shader that I’m creating on the Babylon NME. However, using mesh.color doesn’t work - my model is just completely black:
No vertex colors on the mesh currently, as we were relying on the albedo color on the material to render this model up until now.
Right, so mesh.colors relies on the vertex colors, understood. How would you recommend proceeding in our case, where we’re currently relying on the (uniform) albedo color of the material? Manually adding the vertex colors seems like duplicated work and prone to human error.
Another idea I can think of is to pass the albedo color as a vertex attribute input from code. This would probably work with Node Materials, but I’m not sure if it will work will the node material Editor?
I’m probably still lacking some fundamental knowledge in this area, so - sorry in advance if some of my questions/assumptions don’t quite make sense!
In the second screenshot where you’re using the input block named “test color” you could set it to the imported material’s albedo color like this for example. Note: the albedoColor is stored in linear space so I converted it to gamma space assuming that’s prob the color space you’re expecting it to be in when using it in your material.