[Unity]Billboard的异常表现
2019/09
01
17:09
o.pos = mul(UNITY_MATRIX_P, mul(UNITY_MATRIX_MV, float4(0.0, 0.0, 0.0, 1.0))
+ float4(i.vertex.x, i.vertex.y, 0.0, 0.0)
* float4(_ScaleX, _ScaleY, 1.0, 1.0));
o.pos.y += _OffsetY
UnityEditor中是正确;
但是使用AssetBundle加载, _OffsetY表现则为反向
但是把Shader拷贝一份,动态切成这个拷贝出来的Shader也会变成正常...
最终解决方案为:
o.pos = mul(UNITY_MATRIX_P, mul(UNITY_MATRIX_MV, float4(0.0, 0.0, 0.0, 1.0))
+ float4(i.vertex.x, i.vertex.y +_OffsetY, 0.0, 0.0)
* float4(_ScaleX, _ScaleY, 1.0, 1.0));
CopyRights: The Post by BY-NC-SA For Authorization,Original If Not Noted,Reprint Please Indicate From 老刘@开发笔记
Post Link: [Unity]Billboard的异常表现
Post Link: [Unity]Billboard的异常表现