2019-11-11 17:14:51 +01:00
|
|
|
#version 330
|
2019-11-11 22:22:41 +01:00
|
|
|
uniform sampler2D tex;
|
2020-01-10 20:01:56 +01:00
|
|
|
uniform int channel;
|
2019-11-11 22:22:41 +01:00
|
|
|
in vec2 texCoord;
|
|
|
|
|
in vec4 color;
|
|
|
|
|
out vec4 FragColor;
|
2019-11-11 17:14:51 +01:00
|
|
|
void main() {
|
2020-01-10 20:01:56 +01:00
|
|
|
if (channel == 1) {
|
|
|
|
|
FragColor = textureLod(tex, texCoord, 0).rrra * color;
|
|
|
|
|
}
|
|
|
|
|
else if (channel == 2) {
|
|
|
|
|
FragColor = textureLod(tex, texCoord, 0).ggga * color;
|
|
|
|
|
}
|
|
|
|
|
else if (channel == 3) {
|
|
|
|
|
FragColor = textureLod(tex, texCoord, 0).bbba * color;
|
|
|
|
|
}
|
|
|
|
|
else if (channel == 4) {
|
|
|
|
|
FragColor = textureLod(tex, texCoord, 0).aaaa * color;
|
|
|
|
|
}
|
2020-03-28 10:44:39 +01:00
|
|
|
else if (channel == 5) {
|
|
|
|
|
FragColor = textureLod(tex, texCoord, 0).rgba * color;
|
|
|
|
|
}
|
2020-01-10 20:01:56 +01:00
|
|
|
else {
|
2020-03-20 14:55:42 +01:00
|
|
|
vec4 tex_sample = textureLod(tex, texCoord, 0).rgba;
|
|
|
|
|
tex_sample.rgb *= tex_sample.a;
|
|
|
|
|
FragColor = tex_sample * color;
|
2020-01-10 20:01:56 +01:00
|
|
|
}
|
2019-11-11 17:14:51 +01:00
|
|
|
}
|