2016-02-24 04:42:58 +00:00
|
|
|
#version 330 core
|
|
|
|
in vec2 TexCoords;
|
2016-06-06 20:20:35 +00:00
|
|
|
in vec3 fg;
|
2016-06-06 23:54:15 +00:00
|
|
|
in vec3 bg;
|
|
|
|
flat in int background;
|
2016-02-24 04:42:58 +00:00
|
|
|
|
2016-05-21 04:36:28 +00:00
|
|
|
layout(location = 0, index = 0) out vec4 color;
|
|
|
|
layout(location = 0, index = 1) out vec4 alphaMask;
|
|
|
|
|
2016-02-25 04:37:17 +00:00
|
|
|
uniform sampler2D mask;
|
2016-02-24 04:42:58 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2016-06-06 23:54:15 +00:00
|
|
|
if (background != 0) {
|
|
|
|
alphaMask = vec4(1.0, 1.0, 1.0, 1.0);
|
|
|
|
color = vec4(bg, 1.0);
|
|
|
|
} else {
|
|
|
|
alphaMask = vec4(texture(mask, TexCoords).rgb, 1.0);
|
|
|
|
color = vec4(fg, 1.0);
|
|
|
|
}
|
|
|
|
|
2016-02-24 04:42:58 +00:00
|
|
|
}
|