需求:
1、将Raw Image的顶点坐标映射为UV坐标。
2、设置Raw Image 的Rect.x,y,UV不允许发生变化。
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv; //原本的UV坐标
o.uv2 = o.vertex.xy / 2 + 0.5; //我们自己映射的UV坐标
return o;
}
需求:
1、将Raw Image的顶点坐标映射为UV坐标。
2、设置Raw Image 的Rect.x,y,UV不允许发生变化。
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv; //原本的UV坐标
o.uv2 = o.vertex.xy / 2 + 0.5; //我们自己映射的UV坐标
return o;
}