Unity Shader Graph, UV Map decomposition to use as opacity gradient

1.6k views Asked by At

I'm still trying to learn how Unity Shader graph works but I hit a wall.

I'm getting the UV map, which I know ranges from 0 to 1 in the red channel and 0 to 1 in the green channel.

I'm extracting the red channel to blend two textures together but red channels looks weird.

enter image description here

As you can see, if I apply a contrast node, the line separating black and white is WAY to the left. I expected it to be right in the middle. I thought this could be a contrast gotcha but as you can see in the blend node, it shows more of the second texture than the first one.

In the preview node, you can see it has way more white values than black values

What I wanted was to blend the two textures equaly from each side and control the blend (opacity contrast) with a number, with "0" being totally blended and "1" being not blended at all (left side = tex1 and right side = tex2)

Contrast = 1

1

There are 1 answers

0
Vinícius Negrão On BEST ANSWER

I manage to get it working. The red channel wasn't the culprit, but rather the contrast node.

I solved the problem using a REMAP node.

when contrast is 0 Remap In MinMax = 0..1 Out MinMax = 0..1

when contrast is 1 Remap In MinMax = 0.4999..0.5 Out MinMax = 0..1

So it generates a black and white texture with the division line right in the middle

Contrast == 0

Contrast == 1