- Home /
2 Textures on a single mesh
So, I need to make customizable/randomly generated characters/NPCs, and I'm trying to change their faces (and then possibly add other random features) by using multiple textures on them. Keep in mind the whole base character is made of only 1 mesh. I'm trying to get as much customization as possible, so faces and other body parts are all rigged to change their aspect just by scaling/adjusting bones. But what is really giving me headache is texturing them in an efficient way. I can think of only one way to do so, but I'm not sure about it.
At runtime, when a new characters is generated, combine a base texture with a head texture and perhaps other detail textures by instancing them and directly changing their pixels. Would this be good on performance? I don't know if there's a standard way to have multiple textures on a mesh, but I suppose if it existed it would increase draw calls, so what would be best?
To add multiple materials to a mesh, you just change the size in the materials tab of a mesh renderer component. I'm not too sure whether you can switch between these, frankly don't have a clue myself!
Answer by Benproductions1 · Mar 25, 2014 at 06:43 AM
I would just write a custom shader that handles this, keeping in mind that I would have to be very careful when UV mapping the character.
Thank you, I followed Benproductions1 suggestion and wrote a custom shader. Been good to do, since it taught me how to write shaders, and it works like a charm! Thanks!
If you wouldn't $$anonymous$$d, could you accept my answer or close the question. Thanks