couch/shaders/flat.frag

26 lines
405 B
GLSL
Raw Normal View History

2021-01-13 10:42:57 -06:00
#version 330 core
2021-01-19 16:08:37 -06:00
in vec3 UV;
2021-01-13 10:42:57 -06:00
struct Material {
vec3 color;
bool usesColor;
sampler2D tex;
bool usesTex;
};
uniform Material material;
2021-01-13 10:42:57 -06:00
void main() {
2021-01-20 12:50:59 -06:00
gl_FragColor = vec4(0.0);
if (material.usesColor) {
2021-01-20 12:50:59 -06:00
gl_FragColor += vec4(material.color, 1.0);
}
if (material.usesTex) {
2021-01-20 12:50:59 -06:00
gl_FragColor += texture(material.tex, UV.xy / UV.z);
}
if (gl_FragColor.w < 0.99) {
discard;
}
2021-01-13 10:42:57 -06:00
}