Search code examples
openglmaya

Maya can't not use GL_SELECT mode


I'm now working on a points cloud subject. I want to achieve visualization in Maya. And I have finished point display using maya's OpenGL API. Now I want to achieve point picking function, and use OpenGL's selection render mode. But When I switch to this mode, thing goes wrong. Points couldn't display and changing my view also not work.


Solution

  • OpenGL's selection render mode. But When I switch to this mode, thing goes wrong.

    Yes, that's what it does.

    OpenGL selection mode never was properly supported by commonplace drivers. As soon as selection mode is activated Windows will drop back to the old, slow, legacy software fallback implementation. Selection mode had been completely scrapped from modern OpenGL versions and profiles.

    Don't use selection mode!

    Instead project the point to screen space manually. Either by performing the transformation on the CPU, or by using OpenGL transform feedback buffers. Then sort the points into a 2D Kd-tree and use that to perform screen space selection.