diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-12-18 16:27:04 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-12-18 16:27:13 +0300 |
commit | 8839152abf58205c9e2889721dcf14ba380b94c6 (patch) | |
tree | ac17bd1155ffac72deb5e365ccac0f84692c023b /source/blender/draw | |
parent | 6ccf9619153ea412c7a8c320a3d59d9ec50600c8 (diff) |
Fix T59529: Auto smooth not working
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index b0080c70a0d..bb90a5b584e 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -3427,13 +3427,13 @@ static void mesh_create_loop_pos_and_nor(MeshRenderData *rdata, GPUVertBuf *vbo, for (int a = 0; a < poly_len; a++, mpoly++) { const MLoop *mloop = rdata->mloop + mpoly->loopstart; - const float *lnors = (rdata->loop_normals) ? rdata->loop_normals[mpoly->loopstart] : NULL; + const float (*lnors)[3] = (rdata->loop_normals) ? &rdata->loop_normals[mpoly->loopstart] : NULL; const GPUPackedNormal *fnor = (mpoly->flag & ME_SMOOTH) ? NULL : &rdata->poly_normals_pack[a]; for (int b = 0; b < mpoly->totloop; b++, mloop++) { copy_v3_v3(GPU_vertbuf_raw_step(&pos_step), mvert[mloop->v].co); GPUPackedNormal *pnor = (GPUPackedNormal *)GPU_vertbuf_raw_step(&nor_step); if (lnors) { - *pnor = GPU_normal_convert_i10_v3(lnors); + *pnor = GPU_normal_convert_i10_v3(lnors[b]); } else if (fnor) { *pnor = *fnor; @@ -3461,7 +3461,7 @@ static void mesh_create_loop_pos_and_nor(MeshRenderData *rdata, GPUVertBuf *vbo, for (int a = 0; a < poly_len; a++, mpoly++) { const MLoop *mloop = rdata->mloop + mpoly->loopstart; - const float *lnors = (rdata->loop_normals) ? rdata->loop_normals[mpoly->loopstart] : NULL; + const float (*lnors)[3] = (rdata->loop_normals) ? &rdata->loop_normals[mpoly->loopstart] : NULL; const GPUPackedNormal *fnor = (mpoly->flag & ME_SMOOTH) ? NULL : &rdata->poly_normals_pack[a]; if (p_origindex[a] == ORIGINDEX_NONE) { continue; @@ -3470,7 +3470,7 @@ static void mesh_create_loop_pos_and_nor(MeshRenderData *rdata, GPUVertBuf *vbo, copy_v3_v3(GPU_vertbuf_raw_step(&pos_step), mvert[mloop->v].co); GPUPackedNormal *pnor = (GPUPackedNormal *)GPU_vertbuf_raw_step(&nor_step); if (lnors) { - *pnor = GPU_normal_convert_i10_v3(lnors); + *pnor = GPU_normal_convert_i10_v3(lnors[b]); } else if (fnor) { *pnor = *fnor; |