Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 8d67f12

Browse files
author
Yuncong Zhang
committed
Fix issue in stroke alpha shader.
1 parent 3df86d2 commit 8d67f12

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

Runtime/Resources/UIWidgets_canvas.cginc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,5 @@ float strokeMask(float u, float v) {
184184
}
185185

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

Runtime/Resources/UIWidgets_canvas_strokeAlpha.shader

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,41 @@ Shader "UIWidgets/canvas_strokeAlpha"
2525
#pragma fragment frag_stroke_alpha
2626
ENDCG
2727
}
28+
29+
Pass { // 1, linear
30+
CGPROGRAM
31+
#define UIWIDGETS_LINEAR
32+
#include "UIWidgets_canvas.cginc"
33+
#pragma vertex vert
34+
#pragma fragment frag_stroke_alpha
35+
ENDCG
36+
}
37+
38+
Pass { // 2, radial
39+
CGPROGRAM
40+
#define UIWIDGETS_RADIAL
41+
#include "UIWidgets_canvas.cginc"
42+
#pragma vertex vert
43+
#pragma fragment frag_stroke_alpha
44+
ENDCG
45+
}
46+
47+
Pass { // 3, sweep
48+
CGPROGRAM
49+
#define UIWIDGETS_SWEEP
50+
#include "UIWidgets_canvas.cginc"
51+
#pragma vertex vert
52+
#pragma fragment frag_stroke_alpha
53+
ENDCG
54+
}
55+
56+
Pass { // 4, image
57+
CGPROGRAM
58+
#define UIWIDGETS_IMAGE
59+
#include "UIWidgets_canvas.cginc"
60+
#pragma vertex vert
61+
#pragma fragment frag_stroke_alpha
62+
ENDCG
63+
}
2864
}
2965
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ public static PictureFlusher.CmdDraw strokeAlpha(PictureFlusher.RenderLayer laye
392392

393393
return PictureFlusher.CmdDraw.create(
394394
mesh: mesh,
395-
pass: 0,
395+
pass: pass,
396396
material: mat,
397397
properties: props
398398
);

0 commit comments

Comments
 (0)