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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-09-29 03:27:53 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-09-29 17:22:09 +0300
commit9b0fd5ef2ae0b2748e505b8bef29c6e25f58efe2 (patch)
treeeaade4a08679b7080d41cea300645338bfb2be68 /source/blender/draw/intern/draw_manager_data.c
parentf6fc863acd7c24874026202d4c2aec50c60b40d2 (diff)
Sculpt: only update draw buffers for visible nodes during paint stroke
Also applies to some other sculpt tools like filter and mask expand. The full update happens after the paint stroke is finished, so it does not happen on view navigation, which would cause a delay. Ref T70295 Differential Revision: https://developer.blender.org/D5922
Diffstat (limited to 'source/blender/draw/intern/draw_manager_data.c')
-rw-r--r--source/blender/draw/intern/draw_manager_data.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index e978ae44bcd..e3d4228ec33 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -923,11 +923,19 @@ static void drw_sculpt_generate_calls(DRWSculptCallbackData *scd, bool use_vcol)
}
}
+ /* Update draw buffers only for visible nodes while painting.
+ * But do update them otherwise so navigating stays smooth. */
+ const bool update_only_visible = rv3d && (rv3d->rflag & RV3D_PAINTING);
+
Mesh *mesh = scd->ob->data;
BKE_pbvh_update_normals(pbvh, mesh->runtime.subdiv_ccg);
- BKE_pbvh_draw_cb(
- pbvh, use_vcol, &frustum, (void (*)(void *, GPU_PBVH_Buffers *))sculpt_draw_cb, scd);
+ BKE_pbvh_draw_cb(pbvh,
+ use_vcol,
+ update_only_visible,
+ &frustum,
+ (void (*)(void *, GPU_PBVH_Buffers *))sculpt_draw_cb,
+ scd);
if (SCULPT_DEBUG_BUFFERS) {
int debug_node_nr = 0;