2019-06-05 20:20:12 -04:00
|
|
|
#version {{version}}
|
2019-06-05 17:35:46 -04:00
|
|
|
// Automatically generated from files in pathfinder/shaders/. Do not edit!
|
|
|
|
|
2019-06-05 20:20:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-24 22:42:32 -05:00
|
|
|
#extension GL_GOOGLE_include_directive : enable
|
|
|
|
|
2019-06-05 20:20:12 -04:00
|
|
|
precision highp float;
|
|
|
|
|
2020-02-24 22:42:32 -05:00
|
|
|
out vec4 oFragColor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-05 20:20:12 -04:00
|
|
|
uniform sampler2D uStencilTexture;
|
2020-02-05 00:50:13 -05:00
|
|
|
uniform sampler2D uPaintTexture;
|
2020-02-24 22:42:32 -05:00
|
|
|
uniform sampler2D uDest;
|
2020-02-22 17:39:03 -05:00
|
|
|
uniform vec2 uFramebufferSize;
|
2019-06-05 20:20:12 -04:00
|
|
|
|
2020-02-05 00:50:13 -05:00
|
|
|
in vec2 vColorTexCoord;
|
2020-02-07 14:46:20 -05:00
|
|
|
in vec2 vMaskTexCoord;
|
2019-06-05 20:20:12 -04:00
|
|
|
|
|
|
|
|
2020-02-24 22:42:32 -05:00
|
|
|
vec4 sampleSrcColor(){
|
2020-02-15 00:55:37 -05:00
|
|
|
float coverage = texture(uStencilTexture, vMaskTexCoord). r;
|
2020-02-24 22:42:32 -05:00
|
|
|
vec4 srcRGBA = texture(uPaintTexture, vColorTexCoord);
|
|
|
|
return vec4(srcRGBA . rgb, srcRGBA . a * coverage);
|
|
|
|
}
|
|
|
|
|
|
|
|
vec4 sampleDestColor(){
|
|
|
|
vec2 destTexCoord = gl_FragCoord . xy / uFramebufferSize;
|
|
|
|
return texture(uDest, destTexCoord);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vec4 blendColors(vec4 destRGBA, vec4 srcRGBA, vec3 blendedRGB){
|
|
|
|
return vec4(srcRGBA . a *(1.0 - destRGBA . a)* srcRGBA . rgb +
|
|
|
|
srcRGBA . a * destRGBA . a * blendedRGB +
|
|
|
|
(1.0 - srcRGBA . a)* destRGBA . a * destRGBA . rgb,
|
|
|
|
1.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void main(){
|
|
|
|
vec4 srcRGBA = sampleSrcColor();
|
|
|
|
oFragColor = vec4(srcRGBA . rgb * srcRGBA . a, srcRGBA . a);
|
2019-06-05 20:20:12 -04:00
|
|
|
}
|
|
|
|
|