Bill Skaggs <weskaggs@primate.ucdavis.edu>

* plug-ins/Lighting/lighting_shade.c: remove artifacts
	when light strikes underside of bumpmapped surface;
	should fix bug #163877.
This commit is contained in:
William Skaggs 2005-01-13 23:04:10 +00:00
parent 15c4486298
commit c8b1dfd54d
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-01-13 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* plug-ins/Lighting/lighting_shade.c: remove artifacts
when light strikes underside of bumpmapped surface;
should fix bug #163877.
2005-01-13 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* plug-ins/bmp/bmp.h

View File

@ -58,7 +58,7 @@ phong_shade (GimpVector3 *position,
if (dist != 0.0)
gimp_vector3_mul (&l, 1.0 / dist);
nl = 2.0 * gimp_vector3_inner_product (&n, &l);
nl = MAX (0., 2.0 * gimp_vector3_inner_product (&n, &l));
lnormal = l;
gimp_vector3_normalize (&lnormal);
@ -74,7 +74,7 @@ phong_shade (GimpVector3 *position,
gimp_vector3_add (&h, &lnormal, &v);
gimp_vector3_normalize (&h);
rv = MAX (0., gimp_vector3_inner_product (&n, &h));
rv = MAX (0.01, gimp_vector3_inner_product (&n, &h));
rv = pow (rv, mapvals.material.highlight);
rv *= nl;