Page MenuHome

Fixed multisampling causing picking to fail
Closed, ArchivedPublicPATCH

Description

Just a simple adjustment to tell OpenGL not to use Multisampling on the offscreen buffer used to render out indexes for picking. When MSAA was occurring (forced by the driver), it caused the indexes returned by the back-buffer to be off and would leave you picking stuff behind faces (or even off screen!)

This was regularly reproducible by having a mesh with some polygons obscuring other faces (or even back-faces) and enabling Z-Occlusion ("Limit selection to visible (clipped by depth buffer)" on 2.5) in Edit Mode. When any AA setting was forced by the driver, the back-buffer would come back (from glReadPixels) smooth and with inaccurate indexes from the mesh cage render.

After patch is applied, both forcing AA and leaving AA disabled still works fine in rendering the main screen while leaving picking correct for both cases. Should improve picking speeds on AA-forced machines as well (since rendering the picking cage indexes will be done without MSAA).

File notes:

- In "WithoutFix.avi" you can see that picking works fine with MSAA when there's no Z-occlusion. However, when I turn on Z-occlusion (and in this case disable X-ray mode), you can see the cursor whenever I try to select a vertex, but the manipulator is selecting something completely different in most cases.

- In "WithFix.avi" you can see a similar setup, except now with the patch applied I turn off X-ray mode and picking still works correctly even with MSAA.

- The FixTest.blend file is a really basic case, but I had originally tested most of this on a fairly dense model with the same results.

Event Timeline

Hi, trying to update the status of the patch tracker. Please respond if this patch is still viable/useful and needs review or if it can be closed.

Bastien Montagne (mont29) changed the task status from Unknown Status to Unknown Status.Aug 10 2014, 12:55 PM
Bastien Montagne (mont29) claimed this task.

Time to archive…