From 17837f58260f8fa29420cba9b95ee10f74612335 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 31 Mar 2003 21:46:06 +0000 Subject: [PATCH] added some commented out code to Image_HeightmapToNormalmap explaining how to do heightmap to normalmap conversion a little bit differently (very insignificant difference, purely code for those who care) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2890 d7cf8633-e32d-0410-b094-e92efae38249 --- image.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/image.c b/image.c index 51cde771..c3430f22 100644 --- 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; -- 2.17.1