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
0
Question by ramonfr · Jun 23, 2012 at 05:44 PM · shadertexturematerialmaterials

Using two colors on the same texture?

Hello.

The shirt of the model needs to be customizable. I mean there are different shirt designs, and you can change their design (like with stripes, clean, etc) and colors (color 1 for the stripes and color 2 for the rest). I don't know how to apply different colors to a texture, specifing which color (or channel) in the image will be replaced.

This image shows what I mean: alt text

I tried few custom shaders, but none of them fit my needs.I'm learning, but I have no idea on how I could do a shader for this.

Is there any other solution beside using a custom shader?

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
0

Answer by Berenger · Jun 23, 2012 at 05:59 PM

You can use a mask (grayscale texture) anda lerp inside the shader. 0 is color1, 1 is color 2.

Comment
Add comment · Show 2 · 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 ramonfr · Jun 23, 2012 at 07:02 PM 0
Share

I made a texture with alpha channel and a normal diffuse texture. I've put a shader that blends these two images. Now I can change the color of the alpha texture, but I can't change the color of the diffuse texture.

This is the shader script: http://pastebin.com/haZLJEnq

This is the result: http://i47.tinypic.com/24ccz05.jpg

avatar image Magnilucent · Mar 15, 2013 at 07:19 AM 0
Share

This is late but the code posted above was very helpful. I have been searching for a way to do what it does for hours.

As for the problem, simply change line #41 to "o.Albedo = c.rgb * (d.rgb*2);".

I've updated a pastebin with that code: http://pastebin.com/XYBd9ZRz

avatar image
0

Answer by Vanblam · Aug 04, 2014 at 11:05 PM

lol I want to use this cause I'm stuck in the same situation. But I'm getting an syntax error at line 7. I'm very new to shaders so I have no clue why that error is showing up.

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
avatar image
0

Answer by GamesDeveloper12 · Jul 27, 2015 at 07:07 PM

hi, could you please share the completed textures, so i can see how to make mine as i am struggling to get this to work.

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

7 People are following this question.

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

Related Questions

How to apply different textures to one model? 1 Answer

Get Texture 2D after all shader passes are applied 0 Answers

Shader: get back scene pixel color? 1 Answer

Changing Eye Colour (Colour only non-white parts of a texture?) 2 Answers

How can i change detail texture? 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