2022-10-31 00:51:51 -04:00
|
|
|
#version 330 core
|
|
|
|
|
|
|
|
out vec4 FragColor;
|
|
|
|
in vec2 outUv;
|
|
|
|
in vec3 outNormal;
|
|
|
|
|
|
|
|
uniform sampler2D tex;
|
2022-11-13 13:03:48 -05:00
|
|
|
uniform int useWhite;
|
2022-11-14 20:44:49 -05:00
|
|
|
uniform vec3 color;
|
2022-10-31 00:51:51 -04:00
|
|
|
|
|
|
|
const vec3 lightDir = vec3(1.0, 1.0, 1.0);
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
vec4 textureColor = texture(tex, outUv);
|
|
|
|
//FragColor = vec4(textureColor.rgb, 1.0f);
|
2022-11-13 13:03:48 -05:00
|
|
|
if (useWhite == 0)
|
|
|
|
FragColor = vec4(vec3(1.0, 0.0f, 0.0f) * dot(lightDir, outNormal), 1.0f);
|
|
|
|
else
|
2022-11-14 20:44:49 -05:00
|
|
|
FragColor = vec4(color, 1.0f);
|
2022-10-31 00:51:51 -04:00
|
|
|
}
|