创建动态字体 选中ttf->Create->TextMeshPro->Font Asset
创建静态字体More
描边:同一个材质球的描边必须一样 静态字体+动态字体 频繁生成动态字体会导致掉帧严重
#ifdef OUTLINE_ON
- c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z));
+ // c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z));
+ // c *= saturate(d - input.param.y);
+ // 修改描边算法, 使用外描边算法
+ half outa = saturate(d - input.param.y) * 0.25 + c.a;
+ c = lerp(input.outlineColor * (1.0 - c.a), input.faceColor, step(0.5,outa));
c *= saturate(d - input.param.y);
#endif
textmeshpro使用的linear space的hdr color 所以需要将rgb转换成对应的hdr color的rgb