Fix for bug #8949: diffuse tangent shading did not use correctly

normalized normal. Patch by André Pinto, thanks!
This commit is contained in:
Brecht Van Lommel 2008-04-29 13:51:47 +00:00
parent 8370991710
commit d5bfb1b6d9

@ -1236,6 +1236,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
else { else {
Crossf(cross, lv, vn); Crossf(cross, lv, vn);
Crossf(vnor, cross, vn); Crossf(vnor, cross, vn);
Normalize(vnor);
} }
if(ma->strand_surfnor > 0.0f) { if(ma->strand_surfnor > 0.0f) {
@ -1253,6 +1254,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
float cross[3]; float cross[3];
Crossf(cross, lv, shi->tang); Crossf(cross, lv, shi->tang);
Crossf(vnor, cross, shi->tang); Crossf(vnor, cross, shi->tang);
Normalize(vnor);
vnor[0]= -vnor[0];vnor[1]= -vnor[1];vnor[2]= -vnor[2]; vnor[0]= -vnor[0];vnor[1]= -vnor[1];vnor[2]= -vnor[2];
vn= vnor; vn= vnor;
} }