summaryrefslogtreecommitdiff
path: root/shaders/skia/535-2.shader_test
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/skia/535-2.shader_test')
-rw-r--r--shaders/skia/535-2.shader_test42
1 files changed, 42 insertions, 0 deletions
diff --git a/shaders/skia/535-2.shader_test b/shaders/skia/535-2.shader_test
new file mode 100644
index 0000000..a3009f7
--- /dev/null
+++ b/shaders/skia/535-2.shader_test
@@ -0,0 +1,42 @@
+[require]
+GLSL >= 1.40
+
+[fragment shader]
+#version 140
+
+out vec4 sk_FragColor;
+noperspective in vec4 vinCircleEdge_Stage0;
+noperspective in vec4 vinColor_Stage0;
+void main() {
+ {
+ vec4 circleEdge;
+ circleEdge = vinCircleEdge_Stage0;
+ float d = length(circleEdge.xy);
+ float distanceToOuterEdge = circleEdge.z * (1.0 - d);
+ float edgeAlpha = clamp(distanceToOuterEdge, 0.0, 1.0);
+ float distanceToInnerEdge = circleEdge.z * (d - circleEdge.w);
+ float innerAlpha = clamp(distanceToInnerEdge, 0.0, 1.0);
+ edgeAlpha *= innerAlpha;
+ }
+ {
+ sk_FragColor = vec4(0.0);
+ }
+}
+
+[vertex shader]
+#version 140
+
+uniform vec4 sk_RTAdjust;
+in vec2 inPosition;
+in vec4 inColor;
+in vec4 inCircleEdge;
+noperspective out vec4 vinCircleEdge_Stage0;
+noperspective out vec4 vinColor_Stage0;
+void main() {
+ vinCircleEdge_Stage0 = inCircleEdge;
+ vinColor_Stage0 = inColor;
+ vec2 pos2 = inPosition;
+ gl_Position = vec4(pos2.x, pos2.y, 0.0, 1.0);
+ gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww * sk_RTAdjust.yw, 0.0, gl_Position.w);
+}
+