Hi i’m working in a T-shirt with a print, and I need that the main color don’t affect the the print Like This without multiplying or change the color of the print. How do I can make change the color of the shirt without affect the print.
I’m using a png(Alpha) only with the print, but when i add to a shader it changes the color.
You need to write a custom shader for this that would use a mask like the texture’s alpha channel, to decide which parts of the model to tint. For example when the alpha is 1 you will use the texture color multiplied with the tint and when the alpha is 0 you will only use the texture color without multiplying it with a tint.
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public float r=0,g=0,b=0;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
GameObject.Find("polySurface1").renderer.material.SetColor("_Color",new Color(r,g,b,1));
}
}
To make more clear what I was telling you in my first response, what I meant was that you can use only 1 texture for the whole thing.
The RGB of the texture will contain the print for your t-shirt. Now in the alpha channel of that texture you can set a pixel to 1 when you want it to be modified with a Color or set it to 0 when you do not want it to be modified ( so your print will be copied to the alpha channel of the texture as a black area ).
In your shader code you would do something like this: