Case:
When use ramp textures,maybe you will get strange results when sample texture at uv(0,0)
like using the texture above, when you tex2D at uv(0,0),
float3 ramp = text2D(_RampTex,float2(0,0));
instead of getting black color you will get a white color.
And if you change the 0 to .001, you can get the correct color-black.
Reason:
Because the default wrap mode of the texture in unity is "repeat", So when sample the texture(assume the magniffication is use Bilinear Interpolation).like this
so when you texture's wrap mode setted to repeat, the sample is like this(Becuase with our ramp texture,the the color of v orientation are the same, so we just take the u orientation for example ):
so you will get the wrong result.it's the same result as sample at uv(1,0)(and the sample at uv(1,0) is wrong too)
Solution:
Just set the wrap mode of texture to "Clamp".