couch/shaders/flat.frag

25 lines
369 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
out vec4 FragColor;
struct Material {
vec3 color;
bool usesColor;
sampler2D tex;
bool usesTex;
};
uniform Material material;
2021-01-13 10:42:57 -06:00
void main() {
FragColor = vec4(0.0);
if (material.usesColor) {
FragColor += vec4(material.color, 1.0);
}
if (material.usesTex) {
2021-01-19 16:08:37 -06:00
FragColor += texture(material.tex, UV.xy / UV.z);
}
2021-01-13 10:42:57 -06:00
}