Tweaked fragment shader

This commit is contained in:
Robert 2021-01-26 16:19:58 +01:00
parent 3356413069
commit d58d850a45

View file

@ -20,7 +20,9 @@ void main()
vec3 norm = normalize(oNormal);
vec3 lightDir = normalize(lightPos - oFragPos);
float diff = max(dot(norm, lightDir), 0.0);
float diff = max(dot(norm, lightDir), 0.0) * 10.0;
diff *= min(1.0 / length(lightPos - oFragPos), 10.0);
vec3 diffuse = diff * lightColor;
vec4 objColor = mix(texture(texture1, oUV), texture(texture2, oUV), 0.2);