mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Attenuate the light ambient in lighting.glsl (Fixes #3597)
This commit is contained in:
parent
f0e488e9c5
commit
77bc807305
@ -20,9 +20,7 @@ vec4 doLighting(vec3 viewPos, vec3 viewNormal, vec4 vertexColor)
|
||||
d = length(lightDir);
|
||||
lightDir = normalize(lightDir);
|
||||
|
||||
lightResult.xyz += ambient * gl_LightSource[i].ambient.xyz;
|
||||
lightResult.xyz += diffuse.xyz * gl_LightSource[i].diffuse.xyz * clamp(1.0 / (gl_LightSource[i].constantAttenuation + gl_LightSource[i].linearAttenuation * d + gl_LightSource[i].quadraticAttenuation * d * d), 0.0, 1.0)
|
||||
* max(dot(viewNormal.xyz, lightDir), 0.0);
|
||||
lightResult.xyz += (ambient * gl_LightSource[i].ambient.xyz + diffuse.xyz * gl_LightSource[i].diffuse.xyz * max(dot(viewNormal.xyz, lightDir), 0.0)) * clamp(1.0 / (gl_LightSource[i].constantAttenuation + gl_LightSource[i].linearAttenuation * d + gl_LightSource[i].quadraticAttenuation * d * d), 0.0, 1.0);
|
||||
}
|
||||
|
||||
lightResult.xyz += gl_LightModel.ambient.xyz * ambient;
|
||||
|
Loading…
Reference in New Issue
Block a user