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 /
  • Help Room /
avatar image
0
Question by GawebStudio · Jan 20, 2018 at 10:52 AM · materialpatternclothingoutfit

Easy way to create clothes with simple color + different pattern

Hi everybody,

I'm working on a game where I'd like to generate random character who will have random outfits.

I'm quite new to Unity but so far, I've been able to change the color of the different parts of the outfits with a color picker. Now I'd like to add the possibility for the cloths to have images on them.

For example, there is a t-shirt with a white texture in my game which is then colored. I'd like to add a heart or a cross on it loaded from a second texture image similar to the first one.

I tried to apply the second texture to the details albedo but it messes the colors of the cloth.

Is what I'm asking possible and if yes, how to achieve ?

Thanks !

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by GawebStudio · Jan 20, 2018 at 01:45 PM

Ok, so to answer myself. It's not the perfect solution but it's quite simple to implement as long as you have the basic texture file.

  1. Start by duplicating your texture file

  2. Edit the first one and make it black & white only

  3. Edit the second and create whatever pattern you want on it, grayscale only

  4. In Unity, add you cloth to your character

  5. In the SkinMesh Renderer, you should have one or more material in the "Materials" tab (not the material list)

  6. Find the one which controls the color part you want. You may have several ones at once.

  7. In your assets folder, duplicate this material

  8. Assign the black/white texture to the first material and your pattern texture to the second material

  9. In the skinmesh renderer materials tab, add a slot and put the pattern material in it

  10. Set your pattern texture Alpha Source to Grayscale and enable Alpha is transparency

You should now be able to colorize the two parts independently while having different patterns for the same cloth. Just create more pattern textures and use a script to exchange them.

There are a few downsides this method so far : You lose the possible shadows you have in the original texture. I didn't bother too much with this but this could actually be easily solved in step 2 by making grayscale and adding the shadow in the main texture. Or you could use an height map too from what I understood. The second downside is that the color of the cloth will tend to be whiter than intended. Even full black will appear as grey due to the pattern material.

That's about it at the moment. Again, I'm quite new to Unity, been working with it for about a month only so if you have a better solution, let me know. But I guess my solution could help a few other creators if they don't mind the downsides listed.

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

137 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is it posible to access albedo imported image texture via script? 1 Answer

Standard Shader Emissive Warning? 2 Answers

Custom material upon a particle is too light 0 Answers

2D image shader, 3D object UV mapping , Using good lightings,,, somebody help me! 0 Answers

Create a prefab from an instantiated object in the editor 1 Answer


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