Added ambient lighting

This commit is contained in:
Robert 2021-01-25 20:53:28 +01:00
parent dea312a704
commit 482205b96e
9 changed files with 69 additions and 9 deletions

View file

@ -6,7 +6,12 @@ out vec4 FragColor;
uniform sampler2D texture1;
uniform sampler2D texture2;
uniform float ambientStrength;
uniform vec3 ambientColor;
void main()
{
FragColor = mix(texture(texture1, oUV), texture(texture2, oUV), 0.2);
vec3 ambient = ambientColor * ambientStrength;
FragColor = mix(texture(texture1, oUV), texture(texture2, oUV), 0.2) * vec4(ambient, 1.0);
}