added some commented out code to Image_HeightmapToNormalmap explaining how to do...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 31 Mar 2003 21:46:06 +0000 (21:46 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 31 Mar 2003 21:46:06 +0000 (21:46 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2890 d7cf8633-e32d-0410-b094-e92efae38249

image.c

diff --git a/image.c b/image.c
index 51cde77..c3430f2 100644 (file)
--- a/image.c
+++ b/image.c
@@ -1398,6 +1398,14 @@ void Image_HeightmapToNormalmap(const unsigned char *inpixels, unsigned char *ou
                        n[1] = ((p0[0] + p0[1] + p0[2]) - (p2[0] + p2[1] + p2[2]));
                        n[2] = ibumpscale;
                        VectorNormalize(n);
+                       /*
+                       // this should work for the bottom right triangle if anyone wants
+                       // code for that for some reason
+                       n[0] = ((p1[0] + p1[1] + p1[2]) - (p3[0] + p3[1] + p3[2]));
+                       n[1] = ((p2[0] + p2[1] + p2[2]) - (p3[0] + p3[1] + p3[2]));
+                       n[2] = ibumpscale;
+                       VectorNormalize(n);
+                       */
                        out[0] = 128.0f + n[0] * 127.0f;
                        out[1] = 128.0f + n[1] * 127.0f;
                        out[2] = 128.0f + n[2] * 127.0f;