diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-30 00:42:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-30 00:43:16 +0300 |
commit | ff10ff782bde3395447deab4df4895ce270d3679 (patch) | |
tree | 30b94ee18e50073d9506bb59965288485a14cfb3 /source/blender/gpu | |
parent | 24be998b986cb3bdc86527bfcbd792a5c4e7155e (diff) |
Fix wrong sculpt flat shaded normals after recent optimizations
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index ce88b57420e..48f6ae87615 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -250,7 +250,6 @@ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers, /* calculate normal for each polygon only once */ uint mpoly_prev = UINT_MAX; short no[3]; - int vbo_index = 0; for (uint i = 0; i < buffers->face_indices_len; i++) { const MLoopTri *lt = &buffers->looptri[buffers->face_indices[i]]; @@ -282,7 +281,7 @@ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers, const MVert *v = &mvert[vtri[j]]; copy_v3_v3(GPU_vertbuf_raw_step(&pos_step), v->co); - copy_v3_v3_short(GPU_vertbuf_raw_step(&nor_step), v->no); + copy_v3_v3_short(GPU_vertbuf_raw_step(&nor_step), no); if (show_mask) { *(float *)GPU_vertbuf_raw_step(&msk_step) = fmask; empty_mask = empty_mask && (fmask == 0.0f); @@ -293,8 +292,6 @@ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers, const uchar *elem = &vcol[loop_index].r; memcpy(GPU_vertbuf_raw_step(&col_step), elem, sizeof(uchar) * 4); } - - vbo_index++; } } } |