I've read at this forum some questions similar to mine, but no one seems to have the answer for what I'm looking for. I'm working with customizable characters, and what I'm looking for is basically to apply different textures to a single mesh, overlaping them hierarchically (not only replacing one texture with another one), like shown on the image. Does anyone have any clue about how to do that?
asked Jul 21 '10 at 01:27 PM
If the model is a single mesh, with a single material you can just 'add' materials to its mesh in the inspector.
If you look at a model in the inspector with a mesh render component assigned you'll notice you can add further materials by setting the size value. Normally this is for use with mulit sub-meshes, but you can assign as many materials as you like.
Any materials > number of meshes will be applied over the top of the material assigned to the last sub-mesh (if you have a single mesh then its just applied over the top of it). Frankly its rather odd behaviour as although it works for single meshes, its no use for multi sub-mesh models as only the last sub-mesh will have the additional materials applied to it.
Its a bit hard to explain, but if you give it a go, it should become obvious. I asked a question about this behaviour myself, but never really got a good answer as to why it works as it does or if its even intentional.
If you have multiple sub-meshes then its unlikely to be of use, in which case writing a shader is your best. Although I guess you could always write some code to composite a sequence of textures into a final version, avoiding the need for a shader and reducing draw calls.
answered Jul 21 '10 at 06:16 PM
You can achieve that with multi sub-object materials.
Note: This is done in the design phase of your mesh and isn't done inside of Unity.
This involves breaking the character's body apart by poly face and assigning a specific material ID to each separate section. From there each part can have a separate texture applied to it. See Tutorial linked above.
Keep in mind that the more materials you have the more GL draw calls your character requires.
Hope that helps.
answered Jul 21 '10 at 01:36 PM