Projekt-GRK/shaders/shader_tex.frag
2018-06-20 21:34:24 +02:00

19 lines
448 B
GLSL

#version 430 core
uniform vec3 objectColor;
uniform vec3 lightDir;
uniform sampler2D texture;
in vec3 interpNormal;
in vec2 texCoords;
void main()
{
vec3 normal = normalize(interpNormal);
float diffuse = max(dot(normal, -lightDir), 0.0);
vec2 newTexCoords = vec2(texCoords.x, -texCoords.y);
vec4 textureColor = texture2D(texture, newTexCoords);
gl_FragColor = vec4(textureColor.x, textureColor.y, textureColor.z, 1.0);
}