1

I have already implemented a code using normal shader and now I'm converting that to a shader graph. I used uv values to color certain area near the hit point using fragment shaders and how can I get the same results in shader graph custom functions ? Here is my code in normal shader. How can I access this i.uv.x and i.uv.y in shader graphs?

fixed4 frag (v2f i) : SV_Target
{
    fixed4 col = tex2D(_MainTex, i.uv);
    if (abs(i.uv.x - _x) < 0.04 && abs(i.uv.y - _y) < 0.04)
    {
        col = _Color;
    }
    return col;
}

1 Answers1

0

You should use UV Node with a combination of the Split Node.

Hamid Yusifli
  • 9,688
  • 2
  • 24
  • 48