diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-08-15 16:31:54 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-08-15 16:31:54 +0300 |
commit | 4d320f43133b02a43212b017eecdb390476189f2 (patch) | |
tree | 33ce479a4f9185724dcce31f4b70b335161c2b32 /source/blender/editors/sculpt_paint/paint_utils.c | |
parent | 261a02fc596db0e91667d4e3af9204b165ec4006 (diff) |
Edit Mesh Selection: Refactor: Redraw idmap buffer at runtime with only objects inside the rect
But in the future the selection code may also be used in object mode (eg for snapping).
So to avoid using too much VRAM resources, it is good to avoid drawing all objects in the viewport.
The solution was to create an array with only objects that are detected within the selection area.
If the selection operator is modal, objects already detected are not removed from the array until view3d is moved or orbited.
To detect the object, its BoundBox is tested.
Since the Select Engine does not have a dedicated depth texture, whenever a new object is "found" the depth of the objects in the array already drawn is redrawn.
Reviewers: campbellbarton, fclem
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D5435
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_utils.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 806b7c471c6..4b9d9a2cc01 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -392,7 +392,7 @@ static int imapaint_pick_face(ViewContext *vc, /* sample only on the exact position */ ED_view3d_select_id_validate(vc); - *r_index = DRW_select_buffer_sample_point(mval); + *r_index = DRW_select_buffer_sample_point(vc->depsgraph, vc->ar, vc->v3d, mval); if ((*r_index) == 0 || (*r_index) > (unsigned int)totpoly) { return 0; |