Blender Git Commit Log

Git Commits -> Revision 45b764e

Revision 45b764e by Campbell Barton (master)
March 8, 2017, 19:22 (GMT)
3D View: new nethod of opengl selection

Intended to replace legacy GL_SELECT, without the limitations of
sample queries which can't access depth information.

This commit adds VIEW3D_SELECT_PICK_NEAREST and VIEW3D_SELECT_PICK_ALL
which access the depth buffers to detect whats under the pointer,
so initial selection is always the closest item.

The performance of this method depends a lot on the OpenGL
implementations glReadPixels.

Since reading depth can be slow, buffers are cached for object picking
so selecting re-uses depth data, performing 1 draw instead of 3
(for 24, 18, 10 px regions, picking with many items under the pointer).

Occlusion queries draw twice when picking nearest,
so worst case 6x draw calls per selection.

Even with these improvements occlusion queries is faster on AMD hardware.

Depth selection is disabled by default, toggle option under select method.
May enable by default if this works well on different hardware.

Reviewed as D2543

Commit Details:

Full Hash: 45b764e95b9e34cb17dece1cd37eb80dafa1924f
Parent Commit: 817e975
Lines Changed: +1241, -190

3 Added Paths:

/source/blender/gpu/intern/gpu_select_pick.c (+718, -0) (View)
/source/blender/gpu/intern/gpu_select_private.h (+48, -0) (View)
/source/blender/gpu/intern/gpu_select_sample_query.c (+209, -0) (View)

12 Modified Paths:

/release/scripts/startup/bl_ui/space_userpref.py (+1, -0) (Diff)
/source/blender/editors/armature/armature_select.c (+27, -5) (Diff)
/source/blender/editors/armature/editarmature_sketch.c (+1, -1) (Diff)
/source/blender/editors/include/ED_view3d.h (+13, -1) (Diff)
/source/blender/editors/metaball/mball_edit.c (+1, -1) (Diff)
/source/blender/editors/space_view3d/view3d_select.c (+40, -21) (Diff)
/source/blender/editors/space_view3d/view3d_view.c (+46, -11) (Diff)
/source/blender/gpu/CMakeLists.txt (+3, -0) (Diff)
/source/blender/gpu/GPU_select.h (+10, -0) (Diff)
/source/blender/gpu/intern/gpu_select.c (+118, -149) (Diff)
/source/blender/makesdna/DNA_userdef_types.h (+2, -1) (Diff)
/source/blender/makesrna/intern/rna_userdef.c (+4, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021