Hi, I’m looking to define multiple UVs per vertex where if part of the texture from uvs1 has transparency the part of the texture from uvs2 will be rendered (and so on)
Is there an out-of-the-box way to do this? Otherwise, will MaterialPluginBase serve my purposes or will I need to use a Custom Shader? (First time venturing into shaders )
I’m CPU render bound so prefer to put in extra effort for shaders than have overlapping geometry/more draw calls
the use case for this is character customisation where the user selects different hair/face/skin colour, etc
You can access all the UV sets of a mesh in NME, and use them to sample any texture you want - I tried making a simple example here that samples a pixel from one texture using uv1, checks for the red value and uses that value if greater than 0.5, or another texture, this one sampled with uv2, otherwise: Babylon.js Node Material Editor (babylonjs.com)
Thanks for this, it provided me with a better sense of what I was doing. I ended up using a Material Plugin as I wanted to get my hands a bit dirty. For anyone who finds this thread in the future, here’s my material plugin:
Use registerInstancedBuffer to register each attribute and instance.instancedBuffers[attributeName] = x to set values