Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_cursor.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index c5ebcf870a3..164e13ac3c9 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -628,7 +628,7 @@ static bool paint_draw_tex_overlay(UnifiedPaintSettings *ups,
/* Premultiplied alpha blending. */
GPU_blend(GPU_BLEND_ALPHA_PREMULT);
- immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR);
+ immBindBuiltinProgram(GPU_SHADER_3D_IMAGE_COLOR);
float final_color[4] = {1.0f, 1.0f, 1.0f, 1.0f};
if (!col) {
@@ -720,7 +720,7 @@ static bool paint_draw_cursor_overlay(
GPU_blend(GPU_BLEND_ALPHA_PREMULT);
- immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR);
+ immBindBuiltinProgram(GPU_SHADER_3D_IMAGE_COLOR);
float final_color[4] = {UNPACK3(U.sculpt_paint_overlay_col), 1.0f};
mul_v4_fl(final_color, brush->cursor_overlay_alpha * 0.01f);
@@ -915,7 +915,7 @@ static void paint_draw_curve_cursor(Brush *brush, ViewContext *vc)
/* Draw the bezier handles and the curve segment between the current and next point. */
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
- immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+ immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
float selec_col[4], handle_col[4], pivot_col[4];
UI_GetThemeColorType4fv(TH_VERTEX_SELECT, SPACE_VIEW3D, selec_col);
@@ -1145,11 +1145,10 @@ static void sculpt_geometry_preview_lines_draw(const uint gpuattr,
}
GPU_line_width(1.0f);
- if (ss->preview_vert_index_count > 0) {
- immBegin(GPU_PRIM_LINES, ss->preview_vert_index_count);
- for (int i = 0; i < ss->preview_vert_index_count; i++) {
- immVertex3fv(gpuattr,
- SCULPT_vertex_co_for_grab_active_get(ss, ss->preview_vert_index_list[i]));
+ if (ss->preview_vert_count > 0) {
+ immBegin(GPU_PRIM_LINES, ss->preview_vert_count);
+ for (int i = 0; i < ss->preview_vert_count; i++) {
+ immVertex3fv(gpuattr, SCULPT_vertex_co_for_grab_active_get(ss, ss->preview_vert_list[i]));
}
immEnd();
}
@@ -1209,7 +1208,7 @@ typedef struct PaintCursorContext {
/* Sculpt related data. */
Sculpt *sd;
SculptSession *ss;
- int prev_active_vertex_index;
+ PBVHVertRef prev_active_vertex;
bool is_stroke_active;
bool is_cursor_over_mesh;
bool is_multires;
@@ -1366,7 +1365,7 @@ static void paint_cursor_sculpt_session_update_and_init(PaintCursorContext *pcon
/* This updates the active vertex, which is needed for most of the Sculpt/Vertex Colors tools to
* work correctly */
- pcontext->prev_active_vertex_index = ss->active_vertex_index;
+ pcontext->prev_active_vertex = ss->active_vertex;
if (!ups->stroke_active) {
pcontext->is_cursor_over_mesh = SCULPT_cursor_geometry_info_update(
C, &gi, mval_fl, (pcontext->brush->falloff_shape == PAINT_FALLOFF_SHAPE_SPHERE));
@@ -1549,7 +1548,7 @@ static void paint_cursor_preview_boundary_data_update(PaintCursorContext *pconte
}
ss->boundary_preview = SCULPT_boundary_data_init(
- pcontext->vc.obact, pcontext->brush, ss->active_vertex_index, pcontext->radius);
+ pcontext->vc.obact, pcontext->brush, ss->active_vertex, pcontext->radius);
}
static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext *pcontext)
@@ -1575,8 +1574,8 @@ static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext *
paint_cursor_update_object_space_radius(pcontext);
- const bool update_previews = pcontext->prev_active_vertex_index !=
- SCULPT_active_vertex_get(pcontext->ss);
+ const bool update_previews = pcontext->prev_active_vertex.i !=
+ SCULPT_active_vertex_get(pcontext->ss).i;
/* Setup drawing. */
wmViewport(&pcontext->region->winrct);
@@ -1870,7 +1869,7 @@ static void paint_cursor_setup_2D_drawing(PaintCursorContext *pcontext)
GPU_line_smooth(true);
pcontext->pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
- immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+ immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
}
static void paint_cursor_setup_3D_drawing(PaintCursorContext *pcontext)