[Unity]Unwrap uv
2020/04
23
14:04
Unity中如何将模型的UV展开呢?算法如下:
v2f vs (appdata v)
{
v2f o;
o.vertex = float4(v.uv0.x * 2.0 - 1.0, v.uv0.y * 2.0 - 1.0, 0.5, 1.0);
o.uv = ComputeScreenPos(o.vertex);
return o;
}
half4 ps(v2f i):SV_Target
{
fixed4 col = tex2D(_MainTexture, i.uv);
return half4(col.xyz, 1);
}
记得添加Cull Off
不然渲染不出来!!
那展开UV有啥用呢?比如烘焙阴影,光照图。。。
CopyRights: The Post by BY-NC-SA For Authorization,Original If Not Noted,Reprint Please Indicate From 老刘@开发笔记
Post Link: [Unity]Unwrap uv
Post Link: [Unity]Unwrap uv