Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_paint_color.c
| Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { | ||||
| float smooth_color[4]; | float smooth_color[4]; | ||||
| SCULPT_neighbor_color_average(ss, smooth_color, vd.vertex); | SCULPT_neighbor_color_average(ss, smooth_color, vd.vertex); | ||||
| float col[4]; | float col[4]; | ||||
| SCULPT_vertex_color_get(ss, vd.vertex, col); | SCULPT_vertex_color_get(ss, vd.vertex, col); | ||||
| blend_color_interpolate_float(col, col, smooth_color, fade); | blend_color_interpolate_float(col, col, smooth_color, fade); | ||||
| SCULPT_vertex_color_set(ss, vd.vertex, col); | SCULPT_vertex_color_set(ss, vd.vertex, col); | ||||
| if (vd.mvert) { | |||||
| BKE_pbvh_vert_mark_update(ss->pbvh, vd.vertex); | |||||
| } | |||||
| } | } | ||||
| BKE_pbvh_vertex_iter_end; | BKE_pbvh_vertex_iter_end; | ||||
| } | } | ||||
| static void do_paint_brush_task_cb_ex(void *__restrict userdata, | static void do_paint_brush_task_cb_ex(void *__restrict userdata, | ||||
| const int n, | const int n, | ||||
| const TaskParallelTLS *__restrict tls) | const TaskParallelTLS *__restrict tls) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { | ||||
| /* Final mix over the original color using brush alpha. */ | /* Final mix over the original color using brush alpha. */ | ||||
| mul_v4_v4fl(buffer_color, color_buffer->color[vd.i], brush->alpha); | mul_v4_v4fl(buffer_color, color_buffer->color[vd.i], brush->alpha); | ||||
| float col[4]; | float col[4]; | ||||
| SCULPT_vertex_color_get(ss, vd.vertex, col); | SCULPT_vertex_color_get(ss, vd.vertex, col); | ||||
| IMB_blend_color_float(col, orig_data.col, buffer_color, brush->blend); | IMB_blend_color_float(col, orig_data.col, buffer_color, brush->blend); | ||||
| CLAMP4(col, 0.0f, 1.0f); | CLAMP4(col, 0.0f, 1.0f); | ||||
| SCULPT_vertex_color_set(ss, vd.vertex, col); | SCULPT_vertex_color_set(ss, vd.vertex, col); | ||||
| if (vd.mvert) { | |||||
| BKE_pbvh_vert_mark_update(ss->pbvh, vd.vertex); | |||||
| } | |||||
| } | } | ||||
| BKE_pbvh_vertex_iter_end; | BKE_pbvh_vertex_iter_end; | ||||
| } | } | ||||
| typedef struct SampleWetPaintTLSData { | typedef struct SampleWetPaintTLSData { | ||||
| int tot_samples; | int tot_samples; | ||||
| float color[4]; | float color[4]; | ||||
| } SampleWetPaintTLSData; | } SampleWetPaintTLSData; | ||||
| ▲ Show 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { | ||||
| } | } | ||||
| blend_color_mix_float(interp_color, interp_color, accum); | blend_color_mix_float(interp_color, interp_color, accum); | ||||
| float col[4]; | float col[4]; | ||||
| SCULPT_vertex_color_get(ss, vd.vertex, col); | SCULPT_vertex_color_get(ss, vd.vertex, col); | ||||
| blend_color_interpolate_float(col, ss->cache->prev_colors[vd.index], interp_color, fade); | blend_color_interpolate_float(col, ss->cache->prev_colors[vd.index], interp_color, fade); | ||||
| SCULPT_vertex_color_set(ss, vd.vertex, col); | SCULPT_vertex_color_set(ss, vd.vertex, col); | ||||
| if (vd.mvert) { | |||||
| BKE_pbvh_vert_mark_update(ss->pbvh, vd.vertex); | |||||
| } | |||||
| } | } | ||||
| BKE_pbvh_vertex_iter_end; | BKE_pbvh_vertex_iter_end; | ||||
| } | } | ||||
| static void do_smear_store_prev_colors_task_cb_exec(void *__restrict userdata, | static void do_smear_store_prev_colors_task_cb_exec(void *__restrict userdata, | ||||
| const int n, | const int n, | ||||
| const TaskParallelTLS *__restrict UNUSED(tls)) | const TaskParallelTLS *__restrict UNUSED(tls)) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines | |||||