uniform
PropertyBlock = new MaterialPropertyBlock();
this.renderers = this.gameObject.GetComponentsInChildren<Renderer>();
foreach (var renderer in this.renderers)
{
renderer.GetPropertyBlock(PropertyBlock);
PropertyBlock.SetColor("_FillColor", FillColor);
renderer.SetPropertyBlock(PropertyBlock);
}
_Time.y
的float精度问题MoreMore2精度问题导致有些uv使用_Time.y
会无法流动
之前有个特效在鸿蒙手机上会有问题 而其他手机正常, shader half全改成float就好了。
spine shader需要与包体一同导出
public void SetMeshRendererFillblend(int blendValue) {
foreach (var renderer in this.renderers)
{
renderer.GetPropertyBlock(PropertyBlock); // 如果不加 电脑模拟器好了 手机还是有问题
PropertyBlock.SetFloat("_Fillblend", blendValue);
renderer.SetPropertyBlock(PropertyBlock);
}
}
float grey = dot(col.rgb, fixed3(0.22, 0.707, 0.071));
return float4(grey,grey,grey, col.a);
// 根据关键字启用或禁用特定的功能
#pragma shader_feature GREY_TO_ORIGIN
// ...
fixed4 frag (v2f i) : COLOR
{
// 根据关键字执行不同的操作
#ifdef GREY_TO_ORIGIN
// 执行与关键字相关的操作
#else
// 执行其他操作
#endif
}
Solution:
将half改为float就可以了。
float min = 0.5 - halfWidth;
float max = 0.5 + halfWidth;
color.a *= step(min, IN.texcoord.y) * step(IN.texcoord.y, max);