From 5a0f397eaa6b5c05a6d312617eeebd96e977fa80 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 6 Oct 2016 03:09:46 +0200 Subject: [PATCH] Fix T49523: very slow normal map tangent computation for rendering in 2.78. --- intern/mikktspace/mikktspace.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c index 8d51816b132..0342ae0146f 100644 --- a/intern/mikktspace/mikktspace.c +++ b/intern/mikktspace/mikktspace.c @@ -579,13 +579,16 @@ static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], cons { // make bbox int c=0, l=0, channel=0; - float fvMin[3] = {INFINITY, INFINITY, INFINITY}; - float fvMax[3] = {-INFINITY, -INFINITY, -INFINITY}; + float fvMin[3], fvMax[3]; float dx=0, dy=0, dz=0, fSep=0; - for (l=iL_in; l<=iR_in; l++) - for (c=0; c<3; c++) + for (c=0; c<3; c++) + { fvMin[c]=pTmpVert[iL_in].vert[c]; fvMax[c]=fvMin[c]; } + for (l=(iL_in+1); l<=iR_in; l++) { + for (c=0; c<3; c++) { if (fvMin[c]>pTmpVert[l].vert[c]) fvMin[c]=pTmpVert[l].vert[c]; - else if (fvMax[c]