From 7f682dd7040e1abacf591b00bfb03fc590493e54 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 2 Sep 2016 17:50:30 +0200 Subject: Fix T49226: Incorrect Material viewport shading of Cycles Normal Map node in Edit mode for an object with Array modifier Was incorrect indexing done in the array. Caused by 5abae51. Not sure why it needed to be changed here, but array here is supposed to be a loop data, so bringing back loop index as it originally was. The shading was wrong in edit mode with BI active as well (so it's not like it's needed for BI only). Patch in collaboration with Alexander Gavrilov (angavrilov), thanks! Should be double-checked and ported to 2.78. --- source/blender/blenkernel/intern/DerivedMesh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 293309cba76..ad3c4f81438 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -3836,7 +3836,7 @@ void DM_draw_attrib_vertex(DMVertexAttribs *attribs, int a, int index, int vert, for (b = 0; b < attribs->tottang; b++) { if (attribs->tang[b].array) { /*const*/ float (*array)[4] = attribs->tang[b].array; - const float *tang = (array) ? array[a * 4 + vert] : zero; + const float *tang = (array) ? array[loop] : zero; glVertexAttrib4fv(attribs->tang[b].gl_index, tang); } } -- cgit v1.2.3