Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_buffers.c
| Show First 20 Lines • Show All 685 Lines • ▼ Show 20 Lines | void GPU_pbvh_grid_buffers_update(GPU_PBVH_Buffers *buffers, | ||||
| const int *sculpt_face_sets, | const int *sculpt_face_sets, | ||||
| const int face_sets_color_seed, | const int face_sets_color_seed, | ||||
| const int face_sets_color_default, | const int face_sets_color_default, | ||||
| const struct CCGKey *key, | const struct CCGKey *key, | ||||
| const int update_flags) | const int update_flags) | ||||
| { | { | ||||
| const bool show_mask = (update_flags & GPU_PBVH_BUFFERS_SHOW_MASK) != 0; | const bool show_mask = (update_flags & GPU_PBVH_BUFFERS_SHOW_MASK) != 0; | ||||
| const bool show_vcol = (update_flags & GPU_PBVH_BUFFERS_SHOW_VCOL) != 0; | const bool show_vcol = (update_flags & GPU_PBVH_BUFFERS_SHOW_VCOL) != 0; | ||||
| const bool show_face_sets = sculpt_face_sets && | |||||
| (update_flags & GPU_PBVH_BUFFERS_SHOW_SCULPT_FACE_SETS) != 0; | |||||
| bool empty_mask = true; | bool empty_mask = true; | ||||
| bool default_face_set = true; | bool default_face_set = true; | ||||
| int i, j, k, x, y; | int i, j, k, x, y; | ||||
| /* Build VBO */ | /* Build VBO */ | ||||
| const int has_mask = key->has_mask; | const int has_mask = key->has_mask; | ||||
| Show All 31 Lines | if (gpu_pbvh_vert_buf_data_set(buffers, vert_count)) { | ||||
| for (i = 0; i < totgrid; i++) { | for (i = 0; i < totgrid; i++) { | ||||
| const int grid_index = grid_indices[i]; | const int grid_index = grid_indices[i]; | ||||
| CCGElem *grid = grids[grid_index]; | CCGElem *grid = grids[grid_index]; | ||||
| int vbo_index = vbo_index_offset; | int vbo_index = vbo_index_offset; | ||||
| uchar face_set_color[4] = {UCHAR_MAX, UCHAR_MAX, UCHAR_MAX, UCHAR_MAX}; | uchar face_set_color[4] = {UCHAR_MAX, UCHAR_MAX, UCHAR_MAX, UCHAR_MAX}; | ||||
| if (subdiv_ccg && sculpt_face_sets) { | if (show_face_sets && subdiv_ccg && sculpt_face_sets) { | ||||
| const int face_index = BKE_subdiv_cgg_grid_to_face_index(subdiv_ccg, grid_index); | const int face_index = BKE_subdiv_cgg_grid_to_face_index(subdiv_ccg, grid_index); | ||||
| const int fset = abs(sculpt_face_sets[face_index]); | const int fset = abs(sculpt_face_sets[face_index]); | ||||
| /* Skip for the default color Face Set to render it white. */ | /* Skip for the default color Face Set to render it white. */ | ||||
| if (fset != face_sets_color_default) { | if (fset != face_sets_color_default) { | ||||
| face_set_overlay_color_get(fset, face_sets_color_seed, face_set_color); | face_set_overlay_color_get(fset, face_sets_color_seed, face_set_color); | ||||
| default_face_set = false; | default_face_set = false; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 458 Lines • Show Last 20 Lines | |||||