ADD: Ambient Lightning
This commit is contained in:
parent
997e1ccbb1
commit
b1111d339e
@ -14,7 +14,7 @@ void main(void) {
|
|||||||
vec3 unitToLightDir = normalize(toLightVector);
|
vec3 unitToLightDir = normalize(toLightVector);
|
||||||
|
|
||||||
float cosTheta = dot(unitNormal, unitToLightDir);
|
float cosTheta = dot(unitNormal, unitToLightDir);
|
||||||
float brightness = max(cosTheta, 0.0);
|
float brightness = max(cosTheta, 0.2);
|
||||||
vec3 diffuse = brightness * lightColor;
|
vec3 diffuse = brightness * lightColor;
|
||||||
outColor = vec4(diffuse, 1.0f) * texture(textureSampler, pass_textureCoords);
|
outColor = vec4(diffuse, 1.0f) * texture(textureSampler, pass_textureCoords);
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user