0312 优化文字包边第一次打开界面可能变粗的问题
| | |
| | | m_Scale: {x: 1, y: 1} |
| | | m_Offset: {x: 0, y: 0} |
| | | - _MainTex: |
| | | m_Texture: {fileID: 0} |
| | | m_Texture: {fileID: 2800000, guid: 7cd825c6867461a4090871836190730f, type: 3} |
| | | m_Scale: {x: 1, y: 1} |
| | | m_Offset: {x: 0, y: 0} |
| | | - _MaskTex: |
| | |
| | | const fixed sinArray[12] = { 0, 0.5, 0.866, 1, 0.866, 0.5, 0, -0.5, -0.866, -1, -0.866, -0.5 };
|
| | | const fixed cosArray[12] = { 1, 0.866, 0.5, 0, -0.5, -0.866, -1, -0.866, -0.5, 0, 0.5, 0.866 };
|
| | |
|
| | | float2 pos = IN.texcoord + _MainTex_TexelSize.xy * float2(cosArray[pIndex], sinArray[pIndex]) * IN.normal.z*0.2; //normal.z 存放 _OutlineWidth
|
| | | // 使用绝对UV偏移,系数基于512x512纹理的参考值
|
| | | // 原公式: _MainTex_TexelSize.xy * offset * width * 0.2 = (1/512) * offset * width * 0.2 ≈ 0.00039 * offset * width
|
| | | float2 uvOffset = float2(cosArray[pIndex], sinArray[pIndex]) * IN.normal.z * 0.0004;
|
| | | float2 pos = IN.texcoord + uvOffset;
|
| | | return IsInRect(pos, IN.uv1, IN.uv2) * (tex2D(_MainTex, pos) + _TextureSampleAdd).w * IN.tangent.w; //tangent.w 存放 _OutlineColor.w
|
| | | }
|
| | |
|