diff options
Diffstat (limited to 'shaders/skia/1996.shader_test')
-rw-r--r-- | shaders/skia/1996.shader_test | 607 |
1 files changed, 607 insertions, 0 deletions
diff --git a/shaders/skia/1996.shader_test b/shaders/skia/1996.shader_test new file mode 100644 index 0000000..7fc88df --- /dev/null +++ b/shaders/skia/1996.shader_test @@ -0,0 +1,607 @@ +[require] +GLSL >= 1.40 + +[fragment shader] +#version 140 + +#extension GL_KHR_blend_equation_advanced : require +out vec4 sk_FragColor; +layout (blend_support_all_equations) out ; +uniform float uSrcTF_Stage0[7]; +uniform mat3 uColorXform_Stage0; +uniform float uDstTF_Stage0[7]; +uniform vec2 uImageIncrement_Stage1; +uniform vec4 uKernel_Stage1[6]; +uniform vec2 uKernelOffset_Stage1; +uniform float uGain_Stage1; +uniform float uBias_Stage1; +uniform vec4 uTexDom_Stage1; +uniform vec3 uDecalParams_Stage1; +uniform vec4 ustart_Stage2_c0_c0_c1_c0; +uniform vec4 uend_Stage2_c0_c0_c1_c0; +uniform sampler2D uTextureSampler_0_Stage0; +uniform sampler2D uTextureSampler_0_Stage1; +noperspective in vec2 vTransformedCoords_0_Stage0; +noperspective in vec2 vTransformedCoords_1_Stage0; +noperspective in vec2 vtextureCoords_Stage0; +flat in vec4 vtextureDomain_Stage0; +flat in vec4 vcolor_Stage0; +float src_tf_Stage0(float x) { + float G = uSrcTF_Stage0[0]; + float A = uSrcTF_Stage0[1]; + float B = uSrcTF_Stage0[2]; + float C = uSrcTF_Stage0[3]; + float D = uSrcTF_Stage0[4]; + float E = uSrcTF_Stage0[5]; + float F = uSrcTF_Stage0[6]; + float s = sign(x); + x = abs(x); + x = x < D ? C * x + F : pow(A * x + B, G) + E; + return s * x; +} +float dst_tf_Stage0(float x) { + float G = uDstTF_Stage0[0]; + float A = uDstTF_Stage0[1]; + float B = uDstTF_Stage0[2]; + float C = uDstTF_Stage0[3]; + float D = uDstTF_Stage0[4]; + float E = uDstTF_Stage0[5]; + float F = uDstTF_Stage0[6]; + float s = sign(x); + x = abs(x); + x = x < D ? C * x + F : pow(A * x + B, G) + E; + return s * x; +} +vec4 gamut_xform_Stage0(vec4 color) { + color.xyz = uColorXform_Stage0 * color.xyz; + return color; +} +vec4 color_xform_Stage0(vec4 color) { + float nonZeroAlpha = max(color.w, 9.9999997473787516e-05); + color = vec4(color.xyz / nonZeroAlpha, nonZeroAlpha); + color.x = src_tf_Stage0(color.x); + color.y = src_tf_Stage0(color.y); + color.z = src_tf_Stage0(color.z); + color = gamut_xform_Stage0(color); + color.x = dst_tf_Stage0(color.x); + color.y = dst_tf_Stage0(color.y); + color.z = dst_tf_Stage0(color.z); + color.xyz *= color.w; + return color; +} +vec4 LinearGradientLayout_Stage2_c0_c0_c0_c0(vec4 _input) { + vec4 _output; + float t = vTransformedCoords_1_Stage0.x + 9.9999997473787516e-06; + _output = vec4(t, 1.0, 0.0, 0.0); + return _output; +} +vec4 SingleIntervalGradientColorizer_Stage2_c0_c0_c1_c0(vec4 _input) { + vec4 _output; + float t = _input.x; + _output = (1.0 - t) * ustart_Stage2_c0_c0_c1_c0 + t * uend_Stage2_c0_c0_c1_c0; + return _output; +} +vec4 TiledGradientEffect_Stage2_c0_c0(vec4 _input) { + vec4 _output; + vec4 t = LinearGradientLayout_Stage2_c0_c0_c0_c0(vec4(1.0)); + { + { + t.x = fract(t.x); + } + _output = SingleIntervalGradientColorizer_Stage2_c0_c0_c1_c0(t); + } + { + _output.xyz *= _output.w; + } + return _output; +} +vec4 blend_src_in(vec4 src, vec4 dst) { + return src * dst.w; +} +vec4 blend_dst_in(vec4 src, vec4 dst) { + return blend_src_in(dst, src); +} +void main() { + vec4 outputColor_Stage0; + { + vec2 textureCoords; + textureCoords = vtextureCoords_Stage0; + vec4 textureDomain; + textureDomain = vtextureDomain_Stage0; + outputColor_Stage0 = vcolor_Stage0; + outputColor_Stage0 = color_xform_Stage0(texture(uTextureSampler_0_Stage0, clamp(textureCoords, textureDomain.xy, textureDomain.zw))) * outputColor_Stage0; + } + vec4 output_Stage1; + { + vec4 sum = vec4(0.0, 0.0, 0.0, 0.0); + vec2 coord = vTransformedCoords_0_Stage0 - uKernelOffset_Stage1 * uImageIncrement_Stage1; + vec4 c; + { + float k = uKernel_Stage1[0].x; + { + vec2 origCoord = coord; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[0].y; + { + vec2 origCoord = coord + vec2(1.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[0].z; + { + vec2 origCoord = coord + vec2(2.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[0].w; + { + vec2 origCoord = coord + vec2(3.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[1].x; + { + vec2 origCoord = coord + vec2(4.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[1].y; + { + vec2 origCoord = coord + vec2(5.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[1].z; + { + vec2 origCoord = coord + vec2(6.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[1].w; + { + vec2 origCoord = coord + vec2(7.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[2].x; + { + vec2 origCoord = coord + vec2(8.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[2].y; + { + vec2 origCoord = coord + vec2(9.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[2].z; + { + vec2 origCoord = coord + vec2(10.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[2].w; + { + vec2 origCoord = coord + vec2(11.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[3].x; + { + vec2 origCoord = coord + vec2(12.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[3].y; + { + vec2 origCoord = coord + vec2(13.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[3].z; + { + vec2 origCoord = coord + vec2(14.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[3].w; + { + vec2 origCoord = coord + vec2(15.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[4].x; + { + vec2 origCoord = coord + vec2(16.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[4].y; + { + vec2 origCoord = coord + vec2(17.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[4].z; + { + vec2 origCoord = coord + vec2(18.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[4].w; + { + vec2 origCoord = coord + vec2(19.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[5].x; + { + vec2 origCoord = coord + vec2(20.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[5].y; + { + vec2 origCoord = coord + vec2(21.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + float k = uKernel_Stage1[5].z; + { + vec2 origCoord = coord + vec2(22.0, 0.0) * uImageIncrement_Stage1; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + c.xyz /= c.w; + c.xyz = clamp(c.xyz, 0.0, 1.0); + sum += c * k; + } + { + vec2 origCoord = vTransformedCoords_0_Stage0; + vec2 clampedCoord; + clampedCoord = clamp(origCoord, uTexDom_Stage1.xy, uTexDom_Stage1.zw); + vec4 textureColor = texture(uTextureSampler_0_Stage1, clampedCoord); + float err = max(abs(clampedCoord.x - origCoord.x) * uDecalParams_Stage1.x, abs(clampedCoord.y - origCoord.y) * uDecalParams_Stage1.y); + if (err > uDecalParams_Stage1.z) { + err = 1.0; + } else if (uDecalParams_Stage1.z < 1.0) { + err = 0.0; + } + c = mix(textureColor, vec4(0.0, 0.0, 0.0, 0.0), err); + } + output_Stage1.w = c.w; + output_Stage1.xyz = clamp(sum.xyz * uGain_Stage1 + uBias_Stage1, 0.0, 1.0); + output_Stage1.xyz *= output_Stage1.w; + } + vec4 output_Stage2; + { + output_Stage2 = blend_dst_in(output_Stage1, TiledGradientEffect_Stage2_c0_c0(vec4(1.0))); + } + { + sk_FragColor = output_Stage2 * outputColor_Stage0; + } +} + +[vertex shader] +#version 140 + +uniform vec4 sk_RTAdjust; +uniform mat3 uCoordTransformMatrix_0_Stage0; +uniform mat3 uCoordTransformMatrix_1_Stage0; +in vec2 position; +in vec2 textureCoords; +in vec4 textureDomain; +in vec4 color; +noperspective out vec2 vTransformedCoords_0_Stage0; +noperspective out vec2 vTransformedCoords_1_Stage0; +noperspective out vec2 vtextureCoords_Stage0; +flat out vec4 vtextureDomain_Stage0; +flat out vec4 vcolor_Stage0; +void main() { + vec2 pos2 = position; + vTransformedCoords_0_Stage0 = (uCoordTransformMatrix_0_Stage0 * vec3(textureCoords, 1.0)).xy; + vTransformedCoords_1_Stage0 = (uCoordTransformMatrix_1_Stage0 * vec3(textureCoords, 1.0)).xy; + vtextureCoords_Stage0 = textureCoords; + vtextureDomain_Stage0 = textureDomain; + vcolor_Stage0 = color; + 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); +} + |