Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_vertex.cc
| Show First 20 Lines • Show All 432 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void paint_and_tex_color_alpha_intern(VPaint *vp, | static void paint_and_tex_color_alpha_intern(VPaint *vp, | ||||
| const ViewContext *vc, | const ViewContext *vc, | ||||
| const float co[3], | const float co[3], | ||||
| float r_rgba[4]) | float r_rgba[4]) | ||||
| { | { | ||||
| const Brush *brush = BKE_paint_brush(&vp->paint); | const Brush *brush = BKE_paint_brush(&vp->paint); | ||||
| float rgba[4]; | |||||
| BLI_assert(brush->mtex.tex != nullptr); | BLI_assert(brush->mtex.tex != nullptr); | ||||
| if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_3D) { | if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_3D) { | ||||
| BKE_brush_sample_tex_3d(vc->scene, brush, co, r_rgba, 0, nullptr); | float texco[3]; | ||||
| copy_v3_v3(texco, co); | |||||
| BKE_brush_sample_tex_rgba(vc->scene, brush, 1, &texco, &rgba, 0, nullptr); | |||||
| } | } | ||||
| else { | else { | ||||
| float co_ss[2]; /* screenspace */ | float co_ss[2]; /* screenspace */ | ||||
| if (ED_view3d_project_float_object( | if (ED_view3d_project_float_object( | ||||
| vc->region, | vc->region, | ||||
| co, | co, | ||||
| co_ss, | co_ss, | ||||
| (eV3DProjTest)(V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR)) == V3D_PROJ_RET_OK) { | (eV3DProjTest)(V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR)) == V3D_PROJ_RET_OK) { | ||||
| const float co_ss_3d[3] = {co_ss[0], co_ss[1], 0.0f}; /* we need a 3rd empty value */ | const float texco[3] = {co_ss[0], co_ss[1], 0.0f}; /* we need a 3rd empty value */ | ||||
| BKE_brush_sample_tex_3d(vc->scene, brush, co_ss_3d, r_rgba, 0, nullptr); | BKE_brush_sample_tex_rgba(vc->scene, brush, 1, &texco, &rgba, 0, nullptr); | ||||
| } | } | ||||
| else { | else { | ||||
| zero_v4(r_rgba); | zero_v4(rgba); | ||||
| } | } | ||||
| } | } | ||||
| copy_v4_v4(r_rgba, rgba); | |||||
| } | } | ||||
| static float wpaint_clamp_monotonic(float oldval, float curval, float newval) | static float wpaint_clamp_monotonic(float oldval, float curval, float newval) | ||||
| { | { | ||||
| if (newval < oldval) { | if (newval < oldval) { | ||||
| return MIN2(newval, curval); | return MIN2(newval, curval); | ||||
| } | } | ||||
| if (newval > oldval) { | if (newval > oldval) { | ||||
| ▲ Show 20 Lines • Show All 3,738 Lines • Show Last 20 Lines | |||||