#version 330 core out vec4 FragColor; in vec3 ourColor; in vec2 texCoord; in vec3 normal; in vec3 fragPos; uniform sampler2D texture1; uniform float ambientStrength; uniform vec3 lightPos; uniform vec3 lightColor; void main() { vec3 norm = normalize(normal); vec3 lightDir = normalize(lightPos - fragPos); float diff = max(dot(norm, lightDir), 0.0); vec3 diffuse = diff * lightColor; vec3 ambient = ourColor * ambientStrength; vec3 result = (ambient + diffuse); vec4 col = texture(texture1, texCoord) * vec4(ourColor, 1.0f) * vec4(result, 1.0f); if (0 == col.r && 0 == col.g && 0 == col.b) { discard; } FragColor = col; }