|
Here is a patch that uses a draw twice method to select the first possible object.
First I draw a small part of the framebuffer with depth test less or equal and on the second pass, where I have the depth information, I use an equal test. I differentiate between two selection methods: Select first and enumerate. Obviously, only the select first method uses the two-pass method, and in this case I only redraw objects that passed the first pass test, saving some frame rate.
I ended up touching quite a few parts of blender to make this work and i still feel it is more hacky and prone to break than i would like it to be. Parts liable to break are depth-using effects (like Jason Wilkins' on surface brush for instance), solvable through an offscreen buffer for selection (possibly reusable and allocated at startup), and the object skipping code for the second pass that relies on the order of drawable objects being the same. For instance, objects that change selection ID while drawn can foil the optimization. Also I may have inappropriately tagged different selection methods as "enumerate" or "select first". A few pairs of eyes are welcome there too.
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+611 lines, -181 lines) |
Patch |
|
|
release/scripts/startup/bl_ui/space_userpref.py
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
|
source/blender/editors/armature/CMakeLists.txt
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
|
source/blender/editors/armature/editarmature.c
|
View
|
|
2 chunks |
+4 lines, -6 lines |
0 comments
|
Download
|
|
|
source/blender/editors/armature/editarmature_sketch.c
|
View
|
|
4 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
|
|
source/blender/editors/include/ED_view3d.h
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
|
source/blender/editors/interface/resources.c
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
|
source/blender/editors/metaball/mball_edit.c
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
|
source/blender/editors/space_view3d/drawarmature.c
|
View
|
|
24 chunks |
+41 lines, -40 lines |
0 comments
|
Download
|
|
|
source/blender/editors/space_view3d/drawobject.c
|
View
|
|
5 chunks |
+13 lines, -12 lines |
0 comments
|
Download
|
|
|
source/blender/editors/space_view3d/view3d_select.c
|
View
|
|
9 chunks |
+37 lines, -25 lines |
0 comments
|
Download
|
|
|
source/blender/editors/space_view3d/view3d_view.c
|
View
|
|
6 chunks |
+94 lines, -22 lines |
0 comments
|
Download
|
|
|
source/blender/editors/transform/CMakeLists.txt
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
|
source/blender/editors/transform/transform_manipulator.c
|
View
|
|
21 chunks |
+86 lines, -66 lines |
0 comments
|
Download
|
|
|
source/blender/gpu/CMakeLists.txt
|
View
|
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
|
|
source/blender/gpu/GPU_selection.h
|
View
|
|
1 chunk |
+66 lines, -0 lines |
0 comments
|
Download
|
|
|
source/blender/gpu/intern/gpu_selection.c
|
View
|
|
1 chunk |
+233 lines, -0 lines |
0 comments
|
Download
|
|
|
source/blender/makesdna/DNA_userdef_types.h
|
View
|
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
|
|
source/blender/makesrna/intern/rna_scene.c
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
|
source/blender/makesrna/intern/rna_userdef.c
|
View
|
|
3 chunks |
+14 lines, -2 lines |
0 comments
|
Download
|
Total messages: 1
|