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

26 lines
405 B
GLSL

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