Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Replace Particular Color on my Base Map Texture (URP)

Discussion in 'Shader Graph' started by mace44, Jan 30, 2021.

  1. mace44

    mace44

    Joined:
    Feb 8, 2017
    Posts:
    15
    I'm completely new to Shader Graph and was wondering if its possible to replace/swap a particular color...
    like Green (0,1,0) from a color property in Shader Graph. Thanks in advance!
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,580
    Yes there is. Just type in REPLACE keyword in the search field, when placing new node.
     
  3. mace44

    mace44

    Joined:
    Feb 8, 2017
    Posts:
    15
    I was using a Replace Color option in Shader Graph but the problem why it wasn't working for me is my range wasn't high enough. Even though the color is exactly Green (0,1,0) on the texture, I still needed a range.

    upload_2021-1-30_10-33-24.png
     
  4. mace44

    mace44

    Joined:
    Feb 8, 2017
    Posts:
    15
    Still learning... I'm trying to replace multiple colors of a 2D texture. I'm using a Color Mask then using a Replace Color. Now I'm not sure how to apply the updates to the 2D texture. Any advice for this?

    upload_2021-4-20_9-59-8.png
     
  5. mace44

    mace44

    Joined:
    Feb 8, 2017
    Posts:
    15
    Not sure if it's the "right" way, but I used a Blend with a Screen mode to combine them.

    upload_2021-4-20_10-58-3.png
     
  6. Laurens-Paladin-Studios

    Laurens-Paladin-Studios

    Joined:
    Apr 25, 2015
    Posts:
    54
    In this case you get the same result by just simply multiplying the individual channels of the texture with a color and than use the blend function right?

    upload_2021-4-21_12-47-21.png