hm… found the way ![]()
it has to be done in the frag part of the shader with something like that:
fixed4 frag (v2f i) : SV_Target
{
if(i.uv.x > 1 )
{
float tmp;
tmp = i.uv.x;
i.uv.x=frac(i.uv.x);
tmp=tmp-i.uv.x;
i.uv.y +=tmp*0.5;
if(i.uv.y > 1)
{
i.uv.y=1;
i.uv.x=1;
}
}
// sample the texture
fixed4 col = tex2D(_MainTex, i.uv);
// apply fog
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
for a base texture like this one:
giving this result:

The only shitty part is the ‘gray’ limit generated by the non linear UV wrapping:
here:
looks like it’s generated by some floating point accuracy… ?
am not sure tho :-/
happy unitying !
EDIT: thanks to @bgolus for his explainations in this post: How to modify UV mapping in Shader?

