Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by TimTheTitan · Feb 24, 2016 at 07:09 PM · unity 5shadermeshmaterialuv mapping

How to combine several Materials into one?

Hello,

I want to use a highlight/outline shader on interactable objects. As soon as I look at an interactable object it adds a border around the mesh.

This all works, but I have a problem with some models.

For example if I have a weapon with attachments. Let's say I have a weapon as GameObject, A silencer and a scope as Child GameObjects.

I noticed the highlights worked seperately, which is obvious. So I used Blender to combine the Meshes. Now the weapon, silencer and scope are combined and are in one GameObject.

The problem now is that the highlight only works (I think) on the last Material. Then I noticed that the Mesh has 3 SubMeshes. alt text Yes this is another example (Not my model)

Then I tried to put all the UV Maps in one with Blender. When I did that, the Materials weren't shown correctly.

I know I am missing a step and that is probably exporting the UV Map and combine all the Textures into one. I am not really experienced with the 3d and 2d aspects of game development so I prefer to fix this by code.

I haven't really found a solution on the internet. I found many similiar topics, but many didn't solve my problem.

Thanks,

Tim

[Edit] Example of what I want to achieve: https://youtu.be/qbLXNR0n8Ag?t=29s

ss2016-02-24at104625.jpg (14.0 kB)
Comment
Add comment · Show 4
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 Cherno · Feb 24, 2016 at 10:28 PM 1
Share

If you want to use only one texture, you have to combine the texture images into one and then remap the UVs accordingly in Blender. The remapped model can then be exported to Unity.

avatar image TimTheTitan Cherno · Feb 25, 2016 at 08:10 AM 0
Share

@cherno First I would like to thank you for your reply. I know that's an option, but I really hope there's another solution, but I guess not.

If there isn't another solution, can you suggest me some good tutorials/documentation about combining textures into one? (I didn't search the internet yet)

Thanks,

Tim

avatar image Cherno TimTheTitan · Feb 25, 2016 at 09:45 AM 0
Share

You would use any kind of image editing application for that, like GI$$anonymous$$P or Photoshop. However, an easier option would be to just keep the submeshes and multiple materials, and use an outline shader that works right. Try the Silhouette Outline shader from the user wiki. Just use this shader for all materials on an object. You can also try this outline shader, or my modified version of it.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

Unity 5: Using mobile shaders with Point Light and Spot Light 2 Answers

Wireframe material overlapping with mesh 0 Answers

Realistic metalic on mobile 0 Answers

1 Mesh, 1 Material 2 UV channels 1 Normal map? 0 Answers

Hiding edge seams on tiled plane - material shaders 0 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