1
0
Fork 0

WS30: Include ambient light in ALS fragment shader

Previously only the diffuse term was considered in the fragment
shader, leading to very dark scenery and deep shadows.

Now the ambient light term is also included making the scenery
much closer to the way it should be lit.
This commit is contained in:
Stuart Buchanan 2021-10-21 21:34:53 +01:00
parent 0bce3c966f
commit fc42ef3fe4

View file

@ -119,7 +119,7 @@ void main()
vec4 mat_diffuse = texture(diffuseArray, index);
vec4 mat_specular = texture(specularArray, index);
vec4 color = mat_diffuse * NdotL * gl_LightSource[0].diffuse;
vec4 color = gl_Color + mat_diffuse * NdotL * gl_LightSource[0].diffuse;
// Testing code:
// Use rlc even when looking up textures to recreate the extra performance hit