From: havoc Date: Tue, 10 May 2005 00:30:52 +0000 (+0000) Subject: fix inverted normalmaps produced from bumpmaps (directly loaded normalmaps are fine) X-Git-Tag: xonotic-v0.1.0preview~4916 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e34ab8ae58da95d01a976bba6c3b965df2375730;p=xonotic%2Fdarkplaces.git fix inverted normalmaps produced from bumpmaps (directly loaded normalmaps are fine) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5265 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/image.c b/image.c index 745aac10..077baa7f 100644 --- a/image.c +++ b/image.c @@ -1494,8 +1494,8 @@ void Image_HeightmapToNormalmap(const unsigned char *inpixels, unsigned char *ou n[1] = dv[0][2]*dv[1][0]-dv[0][0]*dv[1][2]; n[2] = dv[0][0]*dv[1][1]-dv[0][1]*dv[1][0]; */ - n[0] = ((p1[0] + p1[1] + p1[2]) - (p0[0] + p0[1] + p0[2])); - n[1] = ((p0[0] + p0[1] + p0[2]) - (p2[0] + p2[1] + p2[2])); + n[0] = ((p0[0] + p0[1] + p0[2]) - (p1[0] + p1[1] + p1[2])); + n[1] = ((p2[0] + p2[1] + p2[2]) - (p0[0] + p0[1] + p0[2])); n[2] = ibumpscale; VectorNormalize(n); /*