From e34ab8ae58da95d01a976bba6c3b965df2375730 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 10 May 2005 00:30:52 +0000 Subject: [PATCH] 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 --- image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); /* -- 2.39.2