Hi,
I have a rather simple shader which linearly darkens colors to realize edge blending. Let’s look at it for the left side:
fixed4 frag(v2f i) : SV_Target
{
fixed4 color = tex2D(_MainTex, i.uv);
color.rgb = (i.uv.x / xlen) * step(i.uv.x, xlen) * color.rgb + color.rgb * step(xlen + 0.0001, i.uv.x);
return color;
}
where xlen is the width of the blending area. Unfortunately there’s a visual impression of a slightly brighter area at the lower side of the gradient (s. attachement).
I can’t get rid of it and I would be very grateful for an explanation, why this area is there and what I could do against it.
BTW, I needed to add 0.0001 for the part of the unchanged color, because for some values of xlen there was an unblended line (really, really bright) - is there another way to solve that doubling?
Thanks!