#version 330

in vec2 f_texcoord;
in vec4 vertex_color;
out vec4 outputColor;

uniform sampler2D diffuseMap;
uniform sampler2D normalMap;

void main()
{
	vec2 flipped_texcoord = vec2(f_texcoord.x, 1.0 - f_texcoord.y);

	vec4 diffuse = texture(diffuseMap, flipped_texcoord);

	vec3 normal = texture(normalMap, flipped_texcoord).rgb;
	normal = normalize(normal * 2 - 1);

	outputColor = diffuse;
}