diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-16 16:52:43 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-16 16:52:43 +0300 |
commit | d4ff1a1f2c57cbe05aedf5fd19219323b94466ab (patch) | |
tree | 617be85ac8d3a55513eb0c4233ce7f8db8cd58c0 /source/blender/gpu/intern | |
parent | 379a752ee7653e696dc350ca2f0122fd806a761c (diff) | |
parent | 0bdb1eab82f6582a2df1f55f19a03653846104a0 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 095021c12d8..8779bd71b81 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -1318,10 +1318,15 @@ void GPU_pbvh_grid_buffers_update( normal_float_to_short_v3(no_short, CCG_elem_no(key, elem)); GWN_vertbuf_attr_set(buffers->vert_buf, vbo_id.nor, vbo_index, no_short); - if (has_mask && show_mask) { + if (has_mask) { uchar color_ub[3]; - gpu_color_from_mask_copy(*CCG_elem_mask(key, elem), - diffuse_color, color_ub); + if (show_mask) { + gpu_color_from_mask_copy(*CCG_elem_mask(key, elem), + diffuse_color, color_ub); + } + else { + F3TOCHAR3(diffuse_color, color_ub); + } GWN_vertbuf_attr_set(buffers->vert_buf, vbo_id.col, vbo_index, color_ub); } } @@ -1353,13 +1358,18 @@ void GPU_pbvh_grid_buffers_update( if (has_mask) { uchar color_ub[3]; - gpu_color_from_mask_quad_copy(key, - elems[0], - elems[1], - elems[2], - elems[3], - diffuse_color, - color_ub); + if (show_mask) { + gpu_color_from_mask_quad_copy(key, + elems[0], + elems[1], + elems[2], + elems[3], + diffuse_color, + color_ub); + } + else { + F3TOCHAR3(diffuse_color, color_ub); + } GWN_vertbuf_attr_set(buffers->vert_buf, vbo_id.col, vbo_index, color_ub); } } |