Search Unity

Question Replacing color in RGBA texture makes it grayscale

Discussion in 'Shader Graph' started by Deleted User, Mar 16, 2021.

  1. Deleted User

    Deleted User

    Guest

    Hi. I am trying to replace a selected color in a texture using the replace color node using the simple graph below. However you can see the texture loses it color. I suspect the problem is trying to convert the RGB to RGBA using the Vector4 node, but I may be wrong.

    Screenshot 2021-03-16 101907.jpeg

    Any way to fix this. Thanks.
     
  2. lilacsky824

    lilacsky824

    Joined:
    May 19, 2018
    Posts:
    171
    The problem is you plug vector3 to vector1(float)it will be truncate to vector1(float), which is R channel.
    So XYZ component that you plug into is always from R channel.
    You can split output from Replace Color node then plug RGB to Vector4 node's XYZ component.
    replace.jpg