Tint only one texture and add it onto other textures

Node-based Shader Editor

Tint only one texture and add it onto other textures

Postby Hertzole » Sun Sep 09, 2018 1:52 pm

Hello!

I'm quite new to making shaders and I'm not very familiar with all the operations. I've been trying to make a simple shader that allows me to mix and match textures and add them to a material so they overlay. (I also just realized now I might run into a sorting issue, which is amazing that I haven't done that so far.) My current problem is that if I want to tint one of the textures, everything gets tinted and I don't know how to fix it.

This is what it looks like right now.
Image
As you can see here, the "Eye Tint" applies the color to the whole material, when I only want it to apply to the eye texture.

Any help is appreciated!

Bonus question: How do I add those comment boxes? I can't find it anywhere!
Hertzole
 
Posts: 5
Joined: Sun Sep 09, 2018 1:38 pm

Re: Tint only one texture and add it onto other textures

Postby Ricardo Teixeira » Mon Sep 10, 2018 10:41 am

Hertzole wrote:Hello!

I'm quite new to making shaders and I'm not very familiar with all the operations. I've been trying to make a simple shader that allows me to mix and match textures and add them to a material so they overlay. (I also just realized now I might run into a sorting issue, which is amazing that I haven't done that so far.) My current problem is that if I want to tint one of the textures, everything gets tinted and I don't know how to fix it.

This is what it looks like right now.
Image
As you can see here, the "Eye Tint" applies the color to the whole material, when I only want it to apply to the eye texture.

Any help is appreciated!

Bonus question: How do I add those comment boxes? I can't find it anywhere!


Hello,

Use the Lerp node to combine them.

Use C to create comment boxes.

Let me know if you have nay additional questions, I would be happy to elaborate.

Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Tint only one texture and add it onto other textures

Postby Hertzole » Mon Sep 10, 2018 4:18 pm

Hello!

Thanks for the help! It kinda worked. But just before I go into the "kinda" part I just want to say that I realize now that my message on what I want to do may have become unclear, so just to clarify. I want to overlap different textures and be able to tint every texture that I overlap separately.
Now, I tried the Lerp node and it worked pretty well... until I had to combine it with all the other textures. It works to combine two textures, but I don't know what to do if I want to combine it with 3, 4, 5, or more textures (+ their tints). And when I did some multiplication and/or adding, dragging nodes here and there, it just came off with very weird color results if I changed colors.

This is what it looks like now.
Image

Any advice?
Hertzole
 
Posts: 5
Joined: Sun Sep 09, 2018 1:38 pm

Re: Tint only one texture and add it onto other textures

Postby Ricardo Teixeira » Mon Sep 10, 2018 4:25 pm

We would be happy to help.

The Eye Lerp for example, what's it for? Seems like you should be lerping the base skin and the eye texture after tinting it.

Please do elaborate, thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Tint only one texture and add it onto other textures

Postby Ricardo Teixeira » Mon Sep 10, 2018 4:31 pm

I should also point out that you have a limited number of textures you can use per-shader, with or without ASE.

Be sure to check the Single Channel Masking sample for an alternative way to mask several elements using a single texture channel.
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Tint only one texture and add it onto other textures

Postby Hertzole » Mon Sep 10, 2018 4:56 pm

Ricardo Teixeira wrote:We would be happy to help.

The Eye Lerp for example, what's it for? Seems like you should be lerping the base skin and the eye texture after tinting it.

Please do elaborate, thanks!

The eye lerp is for adding the tinted eye texture to the base texture... I think. At least it's what I want it to do. As I mentioned, I'm not very good at shader stuff and what they all do. With my current setup, in theory, I tint the texture first and then add it to a "complete texture".
Hertzole
 
Posts: 5
Joined: Sun Sep 09, 2018 1:38 pm

Re: Tint only one texture and add it onto other textures

Postby Ricardo Teixeira » Mon Sep 10, 2018 5:17 pm

Hertzole wrote:
Ricardo Teixeira wrote:We would be happy to help.

The Eye Lerp for example, what's it for? Seems like you should be lerping the base skin and the eye texture after tinting it.

Please do elaborate, thanks!

The eye lerp is for adding the tinted eye texture to the base texture... I think. At least it's what I want it to do. As I mentioned, I'm not very good at shader stuff and what they all do. With my current setup, in theory, I tint the texture first and then add it to a "complete texture".


The Lerp node is currently just lerping between the Alpha channel of your Skin texture and the tinted eye texture, it's not adding to the base texture.

Try this:
Image

The result depends on your textures, I would be happy to examine a sample.

Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Tint only one texture and add it onto other textures

Postby Hertzole » Mon Sep 10, 2018 5:41 pm

Ricardo Teixeira wrote:
Hertzole wrote:
Ricardo Teixeira wrote:We would be happy to help.

The Eye Lerp for example, what's it for? Seems like you should be lerping the base skin and the eye texture after tinting it.

Please do elaborate, thanks!

The eye lerp is for adding the tinted eye texture to the base texture... I think. At least it's what I want it to do. As I mentioned, I'm not very good at shader stuff and what they all do. With my current setup, in theory, I tint the texture first and then add it to a "complete texture".


The Lerp node is currently just lerping between the Alpha channel of your Skin texture and the tinted eye texture, it's not adding to the base texture.

Try this:
Image

The result depends on your textures, I would be happy to examine a sample.

Thanks!

Hello!

I follow your guidelines and it worked perfectly! And I think I understand now how to use the lerp node properly now with my setup!
Also, you mentioned there being a texture limit. Do you happen to know that limit? And is normal maps and such affected by that limit?

Thanks a ton!
Hertzole
 
Posts: 5
Joined: Sun Sep 09, 2018 1:38 pm

Re: Tint only one texture and add it onto other textures

Postby Ricardo Teixeira » Mon Sep 10, 2018 5:51 pm

Happy to hear it!

The limit depends on the shader model used, and a couple of Unity specific uses meaning that the actual sampler limit varies depending on your project.

I recommend looking into the Single channel sample, you can store multiple masks in a single channel using different gray values.

Hope it helps!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Tint only one texture and add it onto other textures

Postby Hertzole » Mon Sep 10, 2018 6:04 pm

Ricardo Teixeira wrote:Happy to hear it!

The limit depends on the shader model used, and a couple of Unity specific uses meaning that the actual sampler limit varies depending on your project.

I recommend looking into the Single channel sample, you can store multiple masks in a single channel using different gray values.

Hope it helps!

I can't seem to find the single channel sample. Does it have another name?
Hertzole
 
Posts: 5
Joined: Sun Sep 09, 2018 1:38 pm

Next

Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 2 guests