Search Unity

Masked textured alpha shader?

Discussion in 'Shaders' started by kidne, May 26, 2016.

  1. kidne

    kidne

    Joined:
    Nov 29, 2013
    Posts:
    27
    I've looked everywhere for what this would be, but I just can't find it anywhere or explain exactly what I'm looking for.

    So here are some playable characters who have 1 material. This material is a body texture with lots of detail. Players can change the color of this creature and the detail still shows.



    Now players can add markings which exist on a second material! I would like a marking mask that is fairly simple, maybe it's just black splotches ( probably white, whatever will work ) and by themselves they would look like this. (Alpha included!)



    When put on the player's characters, they should be able to change the color of the markings and still have the texture ujnderneath shown through. These colors are chosen with a meticulous color picker, so no multiply or any type of color blending should occur. The color of the markings should be as if it's the color they originally chose for the body.



    So now I ask what kind of shader is necessary to achieve this? Currently all my markings look like the black ones above- but I had to paste the body texture onto them otherwise the markings would erase the detail of the main material underneath. Some of these creatures will have more than one main texture, so having to make multiple markings of the same texture will reduce the optimization of my game.

    Like I said before, it MUST be alpha compatible, cannot be any type of color blend, and should show the texture underneath.

    If there is a shader that requires a mask and the original texture you want to be shown underneath it, that will also suffice! Please let me know if you have a solution for me! Thank you
     
  2. Namey5

    Namey5

    Joined:
    Jul 5, 2013
    Posts:
    188
    From what my understanding is of what you want, you could either have an interpolation between 2 colours by a mask texture, then use that lerp to multiply the colour of the original texture. I don't understand if you are using 2 materials though. If you are, you could look for an alpha mask shader, like this one:

    http://forum.unity3d.com/threads/alpha-mask-shader-help.181605/#post-2621428