Skip to content
Snippets Groups Projects
Commit 3c5888e3 authored by David Parks's avatar David Parks
Browse files

Merged in davep/BUG-228263 (pull request #25)

Fix for mismatch on angular attenuation between sunlight on opaque and transparent objects from last commit.
parents f0a9b6c0 0390dc2f
No related branches found
No related tags found
No related merge requests found
......@@ -223,6 +223,7 @@ void main()
float da = dot(norm.xyz, light_dir.xyz);
da = clamp(da, -1.0, 1.0);
da = pow(da, 1.0/1.3);
float final_da = da;
final_da = clamp(final_da, 0.0f, 1.0f);
......@@ -231,7 +232,7 @@ void main()
color.a = final_alpha;
float ambient = da;
float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0);
ambient *= 0.5;
ambient *= ambient;
ambient = (1.0 - ambient);
......
......@@ -331,8 +331,9 @@ void main()
vec3 refnormpersp = normalize(reflect(pos.xyz, norm));
float da = clamp(dot(normalize(norm.xyz), light_dir.xyz), 0.0, 1.0);
da = pow(da, 1.0/1.3);
float ambient = da;
float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0);
ambient *= 0.5;
ambient *= ambient;
ambient = (1.0 - ambient);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment