[Bf-committers] Occlusion Query based selection

Antony Riakiotakis kalast at gmail.com
Thu Mar 29 19:51:09 CEST 2012

Hi Mike, the bad news are that I still don't know the depth of all
objects (I 'could' find out with a glreadpixels but it may inroduce
some latency. And it will only be practical for one object only.) But
this is a workaround in the sense that by differentiating between
different selection requirements (enumerate and select first) I have
eliminated the need to know the depth value of each and every object
under the cursor, I just want to know which one is the first. There
are methods to sort objects and get their depth by using occlusion
quiries and multiple passes(by actually extending the technique I do
here) but the readback of depth for each and every object may kill the
benefit of using occlusion queries in the first place. In essence this
problem stays open. There are some great opinions by various people
here http://blenderartists.org/forum/showthread.php?238426-why-is-gl_select-still-used-to-select-objects-in-Blender
on the subject.

This patch actually mostly works around a limitation of ATI cards so
maybe it can serve until they fix this in their driver. Maybe in this
sense I shouldn't be posting it for review at all. But it is here for
consideration, or maybe it could be used for a separate ATI specific

More information about the Bf-committers mailing list