2019-12-14 21:06:12 +00:00
|
|
|
// VERTEX_SHADER:
|
|
|
|
void main() {
|
|
|
|
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
|
|
|
|
|
|
|
vUv = vec2(aUv.x, aUv.y);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FRAGMENT_SHADER:
|
2019-12-16 05:16:26 +00:00
|
|
|
uniform vec4[3] u_outline_rect;
|
2017-12-01 07:30:11 +00:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
vec4 f = gl_FragCoord;
|
|
|
|
|
|
|
|
f.x += u_viewport.x;
|
|
|
|
f.y = (u_viewport.y + u_viewport.w) - f.y;
|
|
|
|
|
2019-12-16 05:16:26 +00:00
|
|
|
RoundedRect outline = create_rect(u_outline_rect);
|
2017-12-21 17:09:32 +00:00
|
|
|
vec4 color = Texture(u_source, vUv);
|
2019-12-16 05:16:26 +00:00
|
|
|
color = color * (1.0 - clamp(rounded_rect_coverage(outline, f.xy), 0.0, 1.0));
|
2017-12-28 15:41:32 +00:00
|
|
|
setOutputColor(color * u_alpha);
|
2017-12-01 07:30:11 +00:00
|
|
|
}
|