couch/shaders/flat.frag
2021-01-20 20:49:12 -06:00

29 lines
453 B
GLSL

#version 330 core
in vec3 UV;
out vec4 FragColor;
struct Material {
vec3 color;
bool usesColor;
sampler2D tex;
bool usesTex;
float alphaScissor;
};
uniform Material material;
void main() {
FragColor = vec4(0.0);
if (material.usesColor) {
FragColor += vec4(material.color, 1.0);
}
if (material.usesTex) {
FragColor += texture(material.tex, UV.xy / UV.z);
}
if (FragColor.w < material.alphaScissor) {
discard;
}
}