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:
@ -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>
|
2005-01-13 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||||
|
|
||||||
* plug-ins/bmp/bmp.h
|
* plug-ins/bmp/bmp.h
|
||||||
|
@ -58,7 +58,7 @@ phong_shade (GimpVector3 *position,
|
|||||||
if (dist != 0.0)
|
if (dist != 0.0)
|
||||||
gimp_vector3_mul (&l, 1.0 / dist);
|
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;
|
lnormal = l;
|
||||||
gimp_vector3_normalize (&lnormal);
|
gimp_vector3_normalize (&lnormal);
|
||||||
@ -74,7 +74,7 @@ phong_shade (GimpVector3 *position,
|
|||||||
gimp_vector3_add (&h, &lnormal, &v);
|
gimp_vector3_add (&h, &lnormal, &v);
|
||||||
gimp_vector3_normalize (&h);
|
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 = pow (rv, mapvals.material.highlight);
|
||||||
rv *= nl;
|
rv *= nl;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user