When making a material plugin, is there a way to make use of a custom attribute? I looked in the examples and linked BJS classes in the material plugin documentation but it seems none of them are using a custom attribute…
So here’s my attempt to get this working in a simple PG where the box should be red if the attribute is working. Anybody know where I went wrong or if it’s supported? Thanks!
Update: it seems one way to make it work is to assign a customShaderNameResolve function to the material like on the updated PG below. I still wonder if there is or should be a way to do it through the plugin class thou? Maybe could add a getAttributes function?
Hmm now that I’m using this more, I’ve found the need to be able to use the mesh to help decide what attributes to use with the plugin. Was thinking it would be good to pass the mesh in but now seeing how prepareDefines passes both the scene and the mesh, I guess it would be good to pass both to getAttributes as well in case the scene proves useful as well?