Blender  V2.93
sculpt_smooth.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2020 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include "MEM_guardedalloc.h"
25 
26 #include "BLI_blenlib.h"
27 #include "BLI_hash.h"
28 #include "BLI_math.h"
29 #include "BLI_task.h"
30 
31 #include "DNA_brush_types.h"
32 #include "DNA_mesh_types.h"
33 #include "DNA_meshdata_types.h"
34 
35 #include "BKE_brush.h"
36 #include "BKE_context.h"
37 #include "BKE_mesh.h"
38 #include "BKE_mesh_mapping.h"
39 #include "BKE_object.h"
40 #include "BKE_paint.h"
41 #include "BKE_pbvh.h"
42 #include "BKE_scene.h"
43 
44 #include "DEG_depsgraph.h"
45 
46 #include "WM_api.h"
47 #include "WM_message.h"
48 #include "WM_toolsystem.h"
49 #include "WM_types.h"
50 
51 #include "ED_object.h"
52 #include "ED_screen.h"
53 #include "ED_sculpt.h"
54 #include "paint_intern.h"
55 #include "sculpt_intern.h"
56 
57 #include "RNA_access.h"
58 #include "RNA_define.h"
59 
60 #include "bmesh.h"
61 
62 #include <math.h>
63 #include <stdlib.h>
64 
66 {
67  float avg[3] = {0.0f, 0.0f, 0.0f};
68  int total = 0;
69  int neighbor_count = 0;
70  const bool is_boundary = SCULPT_vertex_is_boundary(ss, index);
71 
73  SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, index, ni) {
74  neighbor_count++;
75  if (is_boundary) {
76  /* Boundary vertices use only other boundary vertices. */
77  if (SCULPT_vertex_is_boundary(ss, ni.index)) {
78  add_v3_v3(avg, SCULPT_vertex_co_get(ss, ni.index));
79  total++;
80  }
81  }
82  else {
83  /* Interior vertices use all neighbors. */
84  add_v3_v3(avg, SCULPT_vertex_co_get(ss, ni.index));
85  total++;
86  }
87  }
89 
90  /* Do not modify corner vertices. */
91  if (neighbor_count <= 2) {
93  return;
94  }
95 
96  /* Avoid division by 0 when there are no neighbors. */
97  if (total == 0) {
99  return;
100  }
101 
102  mul_v3_v3fl(result, avg, 1.0f / total);
103 }
104 
105 /* For bmesh: Average surrounding verts based on an orthogonality measure.
106  * Naturally converges to a quad-like structure. */
107 void SCULPT_bmesh_four_neighbor_average(float avg[3], float direction[3], BMVert *v)
108 {
109 
110  float avg_co[3] = {0.0f, 0.0f, 0.0f};
111  float tot_co = 0.0f;
112 
113  BMIter eiter;
114  BMEdge *e;
115 
116  BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
117  if (BM_edge_is_boundary(e)) {
118  copy_v3_v3(avg, v->co);
119  return;
120  }
121  BMVert *v_other = (e->v1 == v) ? e->v2 : e->v1;
122  float vec[3];
123  sub_v3_v3v3(vec, v_other->co, v->co);
124  madd_v3_v3fl(vec, v->no, -dot_v3v3(vec, v->no));
125  normalize_v3(vec);
126 
127  /* fac is a measure of how orthogonal or parallel the edge is
128  * relative to the direction. */
129  float fac = dot_v3v3(vec, direction);
130  fac = fac * fac - 0.5f;
131  fac *= fac;
132  madd_v3_v3fl(avg_co, v_other->co, fac);
133  tot_co += fac;
134  }
135 
136  /* In case vert has no Edge s. */
137  if (tot_co > 0.0f) {
138  mul_v3_v3fl(avg, avg_co, 1.0f / tot_co);
139 
140  /* Preserve volume. */
141  float vec[3];
142  sub_v3_v3(avg, v->co);
143  mul_v3_v3fl(vec, v->no, dot_v3v3(avg, v->no));
144  sub_v3_v3(avg, vec);
145  add_v3_v3(avg, v->co);
146  }
147  else {
148  zero_v3(avg);
149  }
150 }
151 
152 /* Generic functions for laplacian smoothing. These functions do not take boundary vertices into
153  * account. */
154 
156 {
157  float avg[3] = {0.0f, 0.0f, 0.0f};
158  int total = 0;
159 
161  SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, index, ni) {
162  add_v3_v3(avg, SCULPT_vertex_co_get(ss, ni.index));
163  total++;
164  }
166 
167  if (total > 0) {
168  mul_v3_v3fl(result, avg, 1.0f / total);
169  }
170  else {
172  }
173 }
174 
176 {
177  float avg = 0.0f;
178  int total = 0;
179 
181  SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, index, ni) {
182  avg += SCULPT_vertex_mask_get(ss, ni.index);
183  total++;
184  }
186 
187  if (total > 0) {
188  return avg / total;
189  }
190  return SCULPT_vertex_mask_get(ss, index);
191 }
192 
193 void SCULPT_neighbor_color_average(SculptSession *ss, float result[4], int index)
194 {
195  float avg[4] = {0.0f, 0.0f, 0.0f, 0.0f};
196  int total = 0;
197 
199  SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, index, ni) {
201  total++;
202  }
204 
205  if (total > 0) {
206  mul_v4_v4fl(result, avg, 1.0f / total);
207  }
208  else {
210  }
211 }
212 
213 static void do_enhance_details_brush_task_cb_ex(void *__restrict userdata,
214  const int n,
215  const TaskParallelTLS *__restrict tls)
216 {
217  SculptThreadedTaskData *data = userdata;
218  SculptSession *ss = data->ob->sculpt;
219  Sculpt *sd = data->sd;
220  const Brush *brush = data->brush;
221 
222  PBVHVertexIter vd;
223 
224  float bstrength = ss->cache->bstrength;
225  CLAMP(bstrength, -1.0f, 1.0f);
226 
227  SculptBrushTest test;
229  ss, &test, data->brush->falloff_shape);
230 
231  const int thread_id = BLI_task_parallel_thread_id(tls);
232  BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) {
233  if (!sculpt_brush_test_sq_fn(&test, vd.co)) {
234  continue;
235  }
236 
237  const float fade = bstrength * SCULPT_brush_strength_factor(ss,
238  brush,
239  vd.co,
240  sqrtf(test.dist),
241  vd.no,
242  vd.fno,
243  vd.mask ? *vd.mask : 0.0f,
244  vd.index,
245  thread_id);
246 
247  float disp[3];
248  madd_v3_v3v3fl(disp, vd.co, ss->cache->detail_directions[vd.index], fade);
249  SCULPT_clip(sd, ss, vd.co, disp);
250 
251  if (vd.mvert) {
253  }
254  }
256 }
257 
259  Object *ob,
260  PBVHNode **nodes,
261  const int totnode)
262 {
263  SculptSession *ss = ob->sculpt;
264  Brush *brush = BKE_paint_brush(&sd->paint);
265 
268 
270  const int totvert = SCULPT_vertex_count_get(ss);
272  totvert, 3 * sizeof(float), "details directions");
273 
274  for (int i = 0; i < totvert; i++) {
275  float avg[3];
276  SCULPT_neighbor_coords_average(ss, avg, i);
278  }
279  }
280 
282  .sd = sd,
283  .ob = ob,
284  .brush = brush,
285  .nodes = nodes,
286  };
287 
288  TaskParallelSettings settings;
289  BKE_pbvh_parallel_range_settings(&settings, true, totnode);
291 }
292 
293 static void do_smooth_brush_task_cb_ex(void *__restrict userdata,
294  const int n,
295  const TaskParallelTLS *__restrict tls)
296 {
297  SculptThreadedTaskData *data = userdata;
298  SculptSession *ss = data->ob->sculpt;
299  Sculpt *sd = data->sd;
300  const Brush *brush = data->brush;
301  const bool smooth_mask = data->smooth_mask;
302  float bstrength = data->strength;
303 
304  PBVHVertexIter vd;
305 
306  CLAMP(bstrength, 0.0f, 1.0f);
307 
308  SculptBrushTest test;
310  ss, &test, data->brush->falloff_shape);
311 
312  const int thread_id = BLI_task_parallel_thread_id(tls);
313 
314  BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) {
315  if (!sculpt_brush_test_sq_fn(&test, vd.co)) {
316  continue;
317  }
318  const float fade = bstrength * SCULPT_brush_strength_factor(
319  ss,
320  brush,
321  vd.co,
322  sqrtf(test.dist),
323  vd.no,
324  vd.fno,
325  smooth_mask ? 0.0f : (vd.mask ? *vd.mask : 0.0f),
326  vd.index,
327  thread_id);
328  if (smooth_mask) {
329  float val = SCULPT_neighbor_mask_average(ss, vd.index) - *vd.mask;
330  val *= fade * bstrength;
331  *vd.mask += val;
332  CLAMP(*vd.mask, 0.0f, 1.0f);
333  }
334  else {
335  float avg[3], val[3];
337  sub_v3_v3v3(val, avg, vd.co);
338  madd_v3_v3v3fl(val, vd.co, val, fade);
339  SCULPT_clip(sd, ss, vd.co, val);
340  }
341  if (vd.mvert) {
343  }
344  }
346 }
347 
349  Object *ob,
350  PBVHNode **nodes,
351  const int totnode,
352  float bstrength,
353  const bool smooth_mask)
354 {
355  SculptSession *ss = ob->sculpt;
356  Brush *brush = BKE_paint_brush(&sd->paint);
357 
358  const int max_iterations = 4;
359  const float fract = 1.0f / max_iterations;
361  int iteration, count;
362  float last;
363 
364  CLAMP(bstrength, 0.0f, 1.0f);
365 
366  count = (int)(bstrength * max_iterations);
367  last = max_iterations * (bstrength - count * fract);
368 
369  if (type == PBVH_FACES && !ss->pmap) {
370  BLI_assert(!"sculpt smooth: pmap missing");
371  return;
372  }
373 
376 
377  for (iteration = 0; iteration <= count; iteration++) {
378  const float strength = (iteration != count) ? 1.0f : last;
379 
381  .sd = sd,
382  .ob = ob,
383  .brush = brush,
384  .nodes = nodes,
385  .smooth_mask = smooth_mask,
386  .strength = strength,
387  };
388 
389  TaskParallelSettings settings;
390  BKE_pbvh_parallel_range_settings(&settings, true, totnode);
391  BLI_task_parallel_range(0, totnode, &data, do_smooth_brush_task_cb_ex, &settings);
392  }
393 }
394 
395 void SCULPT_do_smooth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
396 {
397  SculptSession *ss = ob->sculpt;
398 
399  /* NOTE: The enhance brush needs to initialize its state on the first brush step. The stroke
400  * strength can become 0 during the stroke, but it can not change sign (the sign is determined
401  * in the beginning of the stroke. So here it is important to not switch to enhance brush in the
402  * middle of the stroke. */
403  if (ss->cache->bstrength < 0.0f) {
404  /* Invert mode, intensify details. */
405  SCULPT_enhance_details_brush(sd, ob, nodes, totnode);
406  }
407  else {
408  /* Regular mode, smooth. */
409  SCULPT_smooth(sd, ob, nodes, totnode, ss->cache->bstrength, false);
410  }
411 }
412 
413 /* HC Smooth Algorithm. */
414 /* From: Improved Laplacian Smoothing of Noisy Surface Meshes */
415 
417  float *disp,
418  const float co[3],
419  float (*laplacian_disp)[3],
420  const int v_index,
421  const float origco[3],
422  const float alpha)
423 {
424  float laplacian_smooth_co[3];
425  float weigthed_o[3], weigthed_q[3], d[3];
426  SCULPT_neighbor_coords_average(ss, laplacian_smooth_co, v_index);
427 
428  mul_v3_v3fl(weigthed_o, origco, alpha);
429  mul_v3_v3fl(weigthed_q, co, 1.0f - alpha);
430  add_v3_v3v3(d, weigthed_o, weigthed_q);
431  sub_v3_v3v3(laplacian_disp[v_index], laplacian_smooth_co, d);
432 
433  sub_v3_v3v3(disp, laplacian_smooth_co, co);
434 }
435 
437  float *co,
438  float (*laplacian_disp)[3],
439  const int v_index,
440  const float beta,
441  const float fade)
442 {
443  float b_avg[3] = {0.0f, 0.0f, 0.0f};
444  float b_current_vertex[3];
445  int total = 0;
447  SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, v_index, ni) {
448  add_v3_v3(b_avg, laplacian_disp[ni.index]);
449  total++;
450  }
452  if (total > 0) {
453  mul_v3_v3fl(b_current_vertex, b_avg, (1.0f - beta) / total);
454  madd_v3_v3fl(b_current_vertex, laplacian_disp[v_index], beta);
455  mul_v3_fl(b_current_vertex, clamp_f(fade, 0.0f, 1.0f));
456  sub_v3_v3(co, b_current_vertex);
457  }
458 }
459 
461  void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
462 {
463  SculptThreadedTaskData *data = userdata;
464  SculptSession *ss = data->ob->sculpt;
465  const Brush *brush = data->brush;
466  const float bstrength = ss->cache->bstrength;
468 
469  PBVHVertexIter vd;
470  SculptOrigVertData orig_data;
471 
472  SculptBrushTest test;
474  ss, &test, data->brush->falloff_shape);
475  const int thread_id = BLI_task_parallel_thread_id(tls);
476 
477  SCULPT_orig_vert_data_init(&orig_data, data->ob, data->nodes[n]);
478 
479  BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) {
480  SCULPT_orig_vert_data_update(&orig_data, &vd);
481  if (!sculpt_brush_test_sq_fn(&test, vd.co)) {
482  continue;
483  }
484  const float fade = bstrength * SCULPT_brush_strength_factor(ss,
485  brush,
486  vd.co,
487  sqrtf(test.dist),
488  vd.no,
489  vd.fno,
490  vd.mask ? *vd.mask : 0.0f,
491  vd.index,
492  thread_id);
493 
494  float disp[3];
496  ss, disp, vd.co, ss->cache->surface_smooth_laplacian_disp, vd.index, orig_data.co, alpha);
497  madd_v3_v3fl(vd.co, disp, clamp_f(fade, 0.0f, 1.0f));
498  if (vd.mvert) {
500  }
501  }
503 }
504 
506  void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
507 {
508  SculptThreadedTaskData *data = userdata;
509  SculptSession *ss = data->ob->sculpt;
510  const Brush *brush = data->brush;
511  const float bstrength = ss->cache->bstrength;
512  const float beta = brush->surface_smooth_current_vertex;
513 
514  PBVHVertexIter vd;
515 
516  SculptBrushTest test;
518  ss, &test, data->brush->falloff_shape);
519  const int thread_id = BLI_task_parallel_thread_id(tls);
520 
521  BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) {
522  if (!sculpt_brush_test_sq_fn(&test, vd.co)) {
523  continue;
524  }
525  const float fade = bstrength * SCULPT_brush_strength_factor(ss,
526  brush,
527  vd.co,
528  sqrtf(test.dist),
529  vd.no,
530  vd.fno,
531  vd.mask ? *vd.mask : 0.0f,
532  vd.index,
533  thread_id);
535  ss, vd.co, ss->cache->surface_smooth_laplacian_disp, vd.index, beta, fade);
536  }
538 }
539 
540 void SCULPT_do_surface_smooth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
541 {
542  Brush *brush = BKE_paint_brush(&sd->paint);
543 
544  /* Threaded loop over nodes. */
546  .sd = sd,
547  .ob = ob,
548  .brush = brush,
549  .nodes = nodes,
550  };
551 
552  TaskParallelSettings settings;
553  BKE_pbvh_parallel_range_settings(&settings, true, totnode);
554  for (int i = 0; i < brush->surface_smooth_iterations; i++) {
559  }
560 }
General operations, lookup, etc. for blender objects.
struct Brush * BKE_paint_brush(struct Paint *paint)
Definition: paint.c:604
A BVH for high poly meshes.
#define BKE_pbvh_vertex_iter_begin(pbvh, node, vi, mode)
Definition: BKE_pbvh.h:384
PBVHType BKE_pbvh_type(const PBVH *pbvh)
Definition: pbvh.c:1661
#define BKE_pbvh_vertex_iter_end
Definition: BKE_pbvh.h:457
#define PBVH_ITER_UNIQUE
Definition: BKE_pbvh.h:335
PBVHType
Definition: BKE_pbvh.h:209
@ PBVH_FACES
Definition: BKE_pbvh.h:210
void BKE_pbvh_parallel_range_settings(struct TaskParallelSettings *settings, bool use_threading, int totnode)
Definition: pbvh.c:3042
#define BLI_assert(a)
Definition: BLI_assert.h:58
MINLINE float clamp_f(float value, float min, float max)
MINLINE void mul_v4_v4fl(float r[3], const float a[4], float f)
MINLINE void add_v4_v4(float r[4], const float a[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_task_parallel_range(const int start, const int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
Definition: task_range.cc:110
int BLI_task_parallel_thread_id(const TaskParallelTLS *tls)
@ ME_VERT_PBVH_UPDATE
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera CLAMP
#define BM_ITER_ELEM(ele, iter, data, itype)
@ BM_EDGES_OF_VERT
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
static CCL_NAMESPACE_BEGIN const double alpha
int count
#define sqrtf(x)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
Definition: mallocn.c:48
float fract(float a)
Definition: node_math.h:34
const float * SCULPT_vertex_co_get(SculptSession *ss, int index)
Definition: sculpt.c:134
int SCULPT_vertex_count_get(SculptSession *ss)
Definition: sculpt.c:120
void SCULPT_orig_vert_data_update(SculptOrigVertData *orig_data, PBVHVertexIter *iter)
Definition: sculpt.c:1310
void SCULPT_boundary_info_ensure(Object *object)
Definition: sculpt.c:9039
SculptBrushTestFn SCULPT_brush_test_init_with_falloff_shape(SculptSession *ss, SculptBrushTest *test, char falloff_shape)
Definition: sculpt.c:1770
void SCULPT_vertex_random_access_ensure(SculptSession *ss)
Definition: sculpt.c:112
bool SCULPT_vertex_is_boundary(const SculptSession *ss, const int index)
Definition: sculpt.c:868
float SCULPT_brush_strength_factor(SculptSession *ss, const Brush *br, const float brush_point[3], const float len, const short vno[3], const float fno[3], const float mask, const int vertex_index, const int thread_id)
Definition: sculpt.c:2463
const float * SCULPT_vertex_color_get(SculptSession *ss, int index)
Definition: sculpt.c:157
float SCULPT_vertex_mask_get(SculptSession *ss, int index)
Definition: sculpt.c:254
bool SCULPT_stroke_is_first_brush_step(StrokeCache *cache)
Definition: sculpt.c:926
void SCULPT_clip(Sculpt *sd, SculptSession *ss, float co[3], const float val[3])
Definition: sculpt.c:2638
void SCULPT_orig_vert_data_init(SculptOrigVertData *data, Object *ob, PBVHNode *node)
Definition: sculpt.c:1300
#define SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator)
bool(* SculptBrushTestFn)(SculptBrushTest *test, const float co[3])
#define SCULPT_VERTEX_NEIGHBORS_ITER_END(neighbor_iterator)
void SCULPT_surface_smooth_laplacian_step(SculptSession *ss, float *disp, const float co[3], float(*laplacian_disp)[3], const int v_index, const float origco[3], const float alpha)
static void SCULPT_enhance_details_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, const int totnode)
static void SCULPT_do_surface_smooth_brush_displace_task_cb_ex(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
void SCULPT_do_smooth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
void SCULPT_neighbor_coords_average(SculptSession *ss, float result[3], int index)
float SCULPT_neighbor_mask_average(SculptSession *ss, int index)
void SCULPT_surface_smooth_displace_step(SculptSession *ss, float *co, float(*laplacian_disp)[3], const int v_index, const float beta, const float fade)
void SCULPT_smooth(Sculpt *sd, Object *ob, PBVHNode **nodes, const int totnode, float bstrength, const bool smooth_mask)
static void do_enhance_details_brush_task_cb_ex(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
void SCULPT_do_surface_smooth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
static void SCULPT_do_surface_smooth_brush_laplacian_task_cb_ex(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
void SCULPT_neighbor_coords_average_interior(SculptSession *ss, float result[3], int index)
Definition: sculpt_smooth.c:65
void SCULPT_neighbor_color_average(SculptSession *ss, float result[4], int index)
void SCULPT_bmesh_four_neighbor_average(float avg[3], float direction[3], BMVert *v)
static void do_smooth_brush_task_cb_ex(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
float co[3]
Definition: bmesh_class.h:99
float no[3]
Definition: bmesh_class.h:100
int surface_smooth_iterations
float surface_smooth_current_vertex
float surface_smooth_shape_preservation
struct SculptSession * sculpt
struct MVert * mvert
Definition: BKE_pbvh.h:372
short * no
Definition: BKE_pbvh.h:375
float * co
Definition: BKE_pbvh.h:374
float * fno
Definition: BKE_pbvh.h:376
float * mask
Definition: BKE_pbvh.h:377
const float * co
struct MeshElemMap * pmap
Definition: BKE_paint.h:474
struct StrokeCache * cache
Definition: BKE_paint.h:518
struct PBVH * pbvh
Definition: BKE_paint.h:504
Paint paint
float(* surface_smooth_laplacian_disp)[3]
float(* detail_directions)[3]
CCL_NAMESPACE_BEGIN ccl_device float fade(float t)
Definition: svm_noise.h:37
ccl_device_inline float beta(float x, float y)
Definition: util_math.h:666