summaryrefslogtreecommitdiff
path: root/shaders/skia/529-2.shader_test
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/skia/529-2.shader_test')
-rw-r--r--shaders/skia/529-2.shader_test82
1 files changed, 82 insertions, 0 deletions
diff --git a/shaders/skia/529-2.shader_test b/shaders/skia/529-2.shader_test
new file mode 100644
index 0000000..3706b42
--- /dev/null
+++ b/shaders/skia/529-2.shader_test
@@ -0,0 +1,82 @@
+[require]
+GLSL >= 1.40
+
+[fragment shader]
+#version 140
+
+uniform mat4 um_Stage1_c0_c0;
+uniform vec4 uv_Stage1_c0_c0;
+uniform vec4 ucircle_Stage1_c1_c0;
+noperspective in vec2 vEllipseOffsets0_Stage0;
+noperspective in vec2 vEllipseOffsets1_Stage0;
+noperspective in vec4 vinColor_Stage0;
+vec4 ColorMatrixFragmentProcessor_Stage1_c0_c0(vec4 _input) {
+ vec4 _output;
+ vec4 inputColor = _input;
+ {
+ float nonZeroAlpha = max(inputColor.w, 9.9999997473787516e-05);
+ inputColor = vec4(inputColor.xyz / nonZeroAlpha, inputColor.w);
+ }
+ _output = um_Stage1_c0_c0 * inputColor + uv_Stage1_c0_c0;
+ {
+ _output.w = clamp(_output.w, 0.0, 1.0);
+ }
+ return _output;
+}
+vec4 CircleEffect_Stage1_c1_c0(vec4 _input) {
+ vec4 _output;
+ float d;
+ {
+ d = (length((ucircle_Stage1_c1_c0.xy - gl_FragCoord.xy) * ucircle_Stage1_c1_c0.w) - 1.0) * ucircle_Stage1_c1_c0.z;
+ }
+ {
+ _output = _input * clamp(d, 0.0, 1.0);
+ }
+ return _output;
+}
+vec4 blend_multiply(vec4 src, vec4 dst) {
+ return vec4(((1.0 - src.w) * dst.xyz + (1.0 - dst.w) * src.xyz) + src.xyz * dst.xyz, src.w + (1.0 - src.w) * dst.w);
+}
+void main() {
+ vec4 outputCoverage_Stage0;
+ {
+ vec2 scaledOffset = vEllipseOffsets0_Stage0;
+ float test = dot(scaledOffset, scaledOffset) - 1.0;
+ vec2 duvdx = dFdx(vEllipseOffsets0_Stage0);
+ vec2 duvdy = dFdy(vEllipseOffsets0_Stage0);
+ vec2 grad = vec2(vEllipseOffsets0_Stage0.x * duvdx.x + vEllipseOffsets0_Stage0.y * duvdx.y, vEllipseOffsets0_Stage0.x * duvdy.x + vEllipseOffsets0_Stage0.y * duvdy.y);
+ float grad_dot = 4.0 * dot(grad, grad);
+ grad_dot = max(grad_dot, 1.1754999560161448e-38);
+ float invlen = inversesqrt(grad_dot);
+ float edgeAlpha = clamp(0.5 - test * invlen, 0.0, 1.0);
+ outputCoverage_Stage0 = vec4(edgeAlpha);
+ }
+ vec4 output_Stage1;
+ {
+ vec4 inputColor = vec4(outputCoverage_Stage0.xyz, 1.0);
+ output_Stage1 = blend_multiply(ColorMatrixFragmentProcessor_Stage1_c0_c0(inputColor), CircleEffect_Stage1_c1_c0(inputColor));
+ output_Stage1 *= outputCoverage_Stage0.w;
+ }
+}
+
+[vertex shader]
+#version 140
+
+uniform vec4 sk_RTAdjust;
+uniform mat3 uViewM_Stage0;
+in vec2 inPosition;
+in vec4 inColor;
+in vec2 inEllipseOffsets0;
+in vec2 inEllipseOffsets1;
+noperspective out vec2 vEllipseOffsets0_Stage0;
+noperspective out vec2 vEllipseOffsets1_Stage0;
+noperspective out vec4 vinColor_Stage0;
+void main() {
+ vEllipseOffsets0_Stage0 = inEllipseOffsets0;
+ vEllipseOffsets1_Stage0 = inEllipseOffsets1;
+ vinColor_Stage0 = inColor;
+ vec2 pos2 = (uViewM_Stage0 * vec3(inPosition, 1.0)).xy;
+ 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);
+}
+