diff options
Diffstat (limited to 'shaders/skia/175-7.shader_test')
-rw-r--r-- | shaders/skia/175-7.shader_test | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/shaders/skia/175-7.shader_test b/shaders/skia/175-7.shader_test new file mode 100644 index 0000000..234b5c5 --- /dev/null +++ b/shaders/skia/175-7.shader_test @@ -0,0 +1,179 @@ +[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 vec2 uImageIncrement_Stage1_c1_c0; +uniform vec2 uBounds_Stage1_c1_c0; +uniform vec4 uKernel_Stage1_c1_c0[6]; +uniform sampler2D uTextureSampler_0_Stage1; +uniform sampler2D uTextureSampler_1_Stage1; +noperspective in vec4 vcolor_Stage0; +noperspective in vec2 vTransformedCoords_0_Stage0; +vec4 ColorTableEffect_Stage1_c0_c0(vec4 _input) { + vec4 _output; + float nonZeroAlpha = max(_input.w, 9.9999997473787516e-05); + vec4 coord = vec4(_input.xyz / nonZeroAlpha, nonZeroAlpha); + coord = coord * 0.9960939884185791 + vec4(0.0019529999699443579, 0.0019529999699443579, 0.0019529999699443579, 0.0019529999699443579); + _output.w = texture(uTextureSampler_0_Stage1, vec2(coord.w, 0.125)).w; + _output.x = texture(uTextureSampler_0_Stage1, vec2(coord.x, 0.375)).w; + _output.y = texture(uTextureSampler_0_Stage1, vec2(coord.y, 0.625)).w; + _output.z = texture(uTextureSampler_0_Stage1, vec2(coord.z, 0.875)).w; + _output.xyz *= _output.w; + return _output; +} +vec4 GaussianConvolution_Stage1_c1_c0(vec4 _input) { + vec4 _output; + _output = vec4(0.0, 0.0, 0.0, 0.0); + vec2 coord = vTransformedCoords_0_Stage0 - 10.0 * uImageIncrement_Stage1_c1_c0; + vec2 coordSampled = vec2(0.0, 0.0); + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[0].x; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[0].y; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[0].z; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[0].w; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[1].x; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[1].y; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[1].z; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[1].w; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[2].x; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[2].y; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[2].z; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[2].w; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[3].x; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[3].y; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[3].z; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[3].w; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[4].x; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[4].y; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[4].z; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[4].w; + } + coord += uImageIncrement_Stage1_c1_c0; + coordSampled = coord; + if (coord.x >= uBounds_Stage1_c1_c0.x && coord.x <= uBounds_Stage1_c1_c0.y) { + _output += texture(uTextureSampler_1_Stage1, coordSampled) * uKernel_Stage1_c1_c0[5].x; + } + coord += uImageIncrement_Stage1_c1_c0; + _output *= _input; + return _output; +} +vec4 blend_dst_out(vec4 src, vec4 dst) { + return (1.0 - src.w) * dst; +} +void main() { + vec4 outputColor_Stage0; + { + outputColor_Stage0 = vcolor_Stage0; + } + vec4 output_Stage1; + { + vec4 inputColor = vec4(outputColor_Stage0.xyz, 1.0); + output_Stage1 = blend_dst_out(ColorTableEffect_Stage1_c0_c0(inputColor), GaussianConvolution_Stage1_c1_c0(inputColor)); + output_Stage1 *= outputColor_Stage0.w; + } + { + sk_FragColor = output_Stage1; + } +} + +[vertex shader] +#version 140 + +uniform vec4 sk_RTAdjust; +uniform mat3 uViewM_Stage0; +uniform mat3 uCoordTransformMatrix_0_Stage0; +in vec2 inPosition; +in vec4 inColor; +noperspective out vec4 vcolor_Stage0; +noperspective out vec2 vTransformedCoords_0_Stage0; +void main() { + vec4 color = inColor; + vcolor_Stage0 = color; + vec2 pos2 = (uViewM_Stage0 * vec3(inPosition, 1.0)).xy; + vTransformedCoords_0_Stage0 = (uCoordTransformMatrix_0_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); +} + |