Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
13
Question by Dorothysb · Jul 21, 2010 at 01:27 PM · textureslayersmultiple

Multiple textures layered in a single mesh

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?

Many thanksalt text

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
19
Best Answer

Answer by Noise crime · Jul 21, 2010 at 06:16 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.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dorothysb · Jul 23, 2010 at 02:14 PM 0
Share

$$anonymous$$any thanks! It seems to be exactly what I was looking for. I'll try that here. Thanks for replying!

avatar image Dorothysb · Jul 23, 2010 at 03:11 PM 0
Share

Yay! It worked! $$anonymous$$any many thanks! I just have a concern about that. I'll try to make myself clear, because I'm quite a newbie on unity (actually, I'm a character artist with not much experience with engines ). $$anonymous$$y question is: How does unity handle all this maps applied on a single material? I mean, does Unity "converts" all the different textures in a single one into the engine to optimizing the file size?

avatar image Noise crime · Jul 23, 2010 at 05:19 PM 0
Share

Well you're not adding maps, but adding materials, so there is no additional memory overhead. However there is likely to be gpu processing overhead as each material will (I believe) need another render pass per additional material you add to the list. Effectively what you are doing here is (as I understand it) telling Unity to render the mesh with the first material, then render again with the next material in the list and so on.

avatar image Noise crime · Jul 23, 2010 at 05:19 PM 0
Share

There is no texture compositing or optimisation going on, though that should not be a problem. You need all the textures in memory regardless which method you choose.

avatar image Pilot · Oct 13, 2011 at 01:15 AM 0
Share

Omg, just saw this now and it is so helpful!!! Thanks Noisecrime

avatar image
1
Best Answer

Answer by equalsequals · Jul 21, 2010 at 01:36 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.

==

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dorothysb · Jul 21, 2010 at 01:56 PM 0
Share

Yes, but I the character I'm using as a reference for that it's not breaked in so many pieaces. The forearm for example, it's made in one single piece. It really seems that there's a texture overlapping...

avatar image equalsequals · Jul 21, 2010 at 02:17 PM 0
Share

This could be done with the method I mentioned above but with some clever texture mapping techniques.

avatar image equalsequals · Jul 21, 2010 at 02:19 PM 0
Share

You could also go so far as to write a shader that linear interpolates multiple textures together based on masks.

avatar image Dorothysb · Jul 21, 2010 at 02:21 PM 0
Share

Thanks, I'll make some tests here! Cheers

avatar image ScottJ88 · Jun 07, 2013 at 05:46 AM 0
Share

I have not been able to test the original method yet of setting multiple textures.

however I have used the lerps with textures to do this, the lerps have the added bonus that in my case remove the clamp mode stretch.

I have a couple of question, regarding both methods, however I will explain my situation as for you to get a better understanding

I am currently making a mobile game, I am trying to avoid draw calls so have made my own terrain as a single mesh.

Currently the texture res is too low for a single texture, again I dont want to split the terrain into 4 and assign each a texture as thats 4 draw calls ins$$anonymous$$d of 1.

I have done the lerp stuff in UD$$anonymous$$ for the exact same thing but the target platform was PC (portfolio work)

I can make a similar shader in unity without much issue.

So to my questions. the original method of changing the ammount of materials for the mesh have any cost associated, it seemed to be somewhat speculation that it would render the mesh for each texture - thus defeating the point here.

For my example I clamp the texture and tile it twice (so it takes up 1/4 of the mesh, then just offset the other 3 to their location. Problem is that clamp mode has the edge stretch effect, is the case for the original mode?

lastly, out of the two (if the original doesn't cost any more draw calls) is cheaper to do?

avatar image
0

Answer by PetrSevostianov · Feb 09, 2015 at 03:13 PM

Hi! You can try Unity utility CompositeMap: https://www.assetstore.unity3d.com/en/#!/content/28788

It works similar to CompositeMap map in 3ds Max or Layered Texture in Maya and allows to create and customize textures using masks of materials.

Just look at the video: https://www.youtube.com/watch?v=PAKyw2eWld4

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How can you get multiple materials/textures on the same object in unity 5? 2 Answers

How do I apply Multiple textures to a surface? 1 Answer

Better to use multiple objects or textures with basic paperdolling? 0 Answers

how to apply multiple layers of textures to a billboard? 1 Answer

Meshes with multpile texture maps--is it possible? 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges