85 ss, &test,
data->brush->falloff_shape);
89 if (!sculpt_brush_test_sq_fn(&test, vd.
co)) {
102 float smooth_color[4];
132 ss, &test,
data->brush->falloff_shape);
135 float brush_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
144 bool affect_vertex =
false;
145 float distance_to_stroke_location = 0.0f;
151 affect_vertex = sculpt_brush_test_sq_fn(&test, vd.
co);
152 distance_to_stroke_location =
sqrtf(test.
dist);
155 if (!affect_vertex) {
162 distance_to_stroke_location,
172 if (density < 1.0f) {
174 if (hash_noise > density) {
175 noise = density * hash_noise;
181 float paint_color[4];
182 float wet_mix_color[4];
183 float buffer_color[4];
223 ss, &test,
data->brush->falloff_shape);
225 test.
radius *=
data->brush->wet_paint_radius_factor;
229 if (!sculpt_brush_test_sq_fn(&test, vd.
co)) {
240 void *__restrict chunk_join,
241 void *__restrict chunk)
316 float wet_color[4] = {0.0f};
339 CLAMP4(wet_color, 0.0f, 1.0f);
359 .wet_mix_sampled_color = wet_color,
381 ss, &test,
data->brush->falloff_shape);
385 if (!sculpt_brush_test_sq_fn(&test, vd.
co)) {
398 float current_disp[3];
399 float current_disp_norm[3];
400 float interp_color[4];
419 float vertex_disp[3];
420 float vertex_disp_norm[3];
424 if (
dot_v3v3(current_disp_norm, vertex_disp_norm) >= 0.0f) {
427 const float color_interp =
clamp_f(
428 -
dot_v3v3(current_disp_norm, vertex_disp_norm), 0.0f, 1.0f);
473 for (
int i = 0; i < totvert; i++) {
const float * BKE_brush_secondary_color_get(const struct Scene *scene, const struct Brush *brush)
const float * BKE_brush_color_get(const struct Scene *scene, const struct Brush *brush)
General operations, lookup, etc. for blender objects.
struct Brush * BKE_paint_brush(struct Paint *paint)
A BVH for high poly meshes.
#define BKE_pbvh_vertex_iter_begin(pbvh, node, vi, mode)
#define BKE_pbvh_vertex_iter_end
void BKE_pbvh_parallel_range_settings(struct TaskParallelSettings *settings, bool use_threading, int totnode)
PBVHColorBufferNode * BKE_pbvh_node_color_buffer_get(PBVHNode *node)
BLI_INLINE float BLI_hash_int_01(unsigned int k)
MINLINE float clamp_f(float value, float min, float max)
MINLINE void blend_color_mix_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_interpolate_float(float dst[4], const float src1[4], const float src2[4], float t)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void scale_m4_fl(float R[4][4], float scale)
bool is_zero_m4(const float mat[4][4])
void normalize_m4(float R[4][4]) ATTR_NONNULL()
MINLINE void mul_v4_v4fl(float r[3], const float a[4], float f)
MINLINE void mul_v4_fl(float r[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 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 cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void zero_v4(float r[4])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
bool is_finite_v4(const float a[4]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
void BLI_task_parallel_range(const int start, const int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
int BLI_task_parallel_thread_id(const TaskParallelTLS *tls)
#define CLAMP4(vec, b, c)
@ BRUSH_SMEAR_DEFORM_PINCH
@ BRUSH_SMEAR_DEFORM_EXPAND
@ BRUSH_SMEAR_DEFORM_DRAG
void IMB_colormanagement_srgb_to_scene_linear_v3(float pixel[3])
void IMB_blend_color_float(float dst[4], const float src1[4], const float src2[4], IMB_BlendMode mode)
Read Guarded memory(de)allocation.
void *(* MEM_callocN)(size_t len, const char *str)
static float noise(int n)
const float * SCULPT_vertex_co_get(SculptSession *ss, int index)
int SCULPT_vertex_count_get(SculptSession *ss)
void SCULPT_orig_vert_data_update(SculptOrigVertData *orig_data, PBVHVertexIter *iter)
SculptBrushTestFn SCULPT_brush_test_init_with_falloff_shape(SculptSession *ss, SculptBrushTest *test, char falloff_shape)
bool SCULPT_brush_test_cube(SculptBrushTest *test, const float co[3], const float local[4][4], const float roundness)
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)
const float * SCULPT_vertex_color_get(SculptSession *ss, int index)
bool SCULPT_stroke_is_first_brush_step_of_symmetry_pass(StrokeCache *cache)
void SCULPT_calc_area_normal(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3])
bool SCULPT_stroke_is_first_brush_step(StrokeCache *cache)
void SCULPT_orig_vert_data_init(SculptOrigVertData *data, Object *ob, PBVHNode *node)
#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_neighbor_color_average(SculptSession *ss, float result[4], int index)
void SCULPT_do_smear_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
static void do_color_smooth_task_cb_exec(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
static void do_smear_brush_task_cb_exec(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
struct SampleWetPaintTLSData SampleWetPaintTLSData
static void sample_wet_paint_reduce(const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk)
static void do_smear_store_prev_colors_task_cb_exec(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
static void do_sample_wet_paint_task_cb(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
void SCULPT_do_paint_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
static void do_paint_brush_task_cb_ex(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
struct CurveMapping * curve
struct SculptSession * sculpt
struct StrokeCache * cache
float wet_mix_prev_color[4]
float grab_delta_symmetry[3]
struct StrokeCache::@489 paint_brush
TaskParallelReduceFunc func_reduce
size_t userdata_chunk_size
CCL_NAMESPACE_BEGIN ccl_device float fade(float t)