浏览代码

Fix issue in stroke alpha shader.

/main
Yuncong Zhang 5 年前
当前提交
3d0b6526
共有 3 个文件被更改,包括 38 次插入2 次删除
  1. 2
      Runtime/Resources/UIWidgets_canvas.cginc
  2. 36
      Runtime/Resources/UIWidgets_canvas_strokeAlpha.shader
  3. 2
      Runtime/ui/renderer/cmdbufferCanvas/rendering/canvas_shader.cs

2
Runtime/Resources/UIWidgets_canvas.cginc


}
fixed4 frag_stroke_alpha(v2f i) : SV_Target {
return _color * strokeMask(i.ftcoord.x, i.ftcoord.y);
return shader_color(i) * strokeMask(i.ftcoord.x, i.ftcoord.y);
}

36
Runtime/Resources/UIWidgets_canvas_strokeAlpha.shader


#pragma fragment frag_stroke_alpha
ENDCG
}
Pass { // 1, linear
CGPROGRAM
#define UIWIDGETS_LINEAR
#include "UIWidgets_canvas.cginc"
#pragma vertex vert
#pragma fragment frag_stroke_alpha
ENDCG
}
Pass { // 2, radial
CGPROGRAM
#define UIWIDGETS_RADIAL
#include "UIWidgets_canvas.cginc"
#pragma vertex vert
#pragma fragment frag_stroke_alpha
ENDCG
}
Pass { // 3, sweep
CGPROGRAM
#define UIWIDGETS_SWEEP
#include "UIWidgets_canvas.cginc"
#pragma vertex vert
#pragma fragment frag_stroke_alpha
ENDCG
}
Pass { // 4, image
CGPROGRAM
#define UIWIDGETS_IMAGE
#include "UIWidgets_canvas.cginc"
#pragma vertex vert
#pragma fragment frag_stroke_alpha
ENDCG
}
}
}

2
Runtime/ui/renderer/cmdbufferCanvas/rendering/canvas_shader.cs


return PictureFlusher.CmdDraw.create(
mesh: mesh,
pass: 0,
pass: pass,
material: mat,
properties: props
);

正在加载...
取消
保存