I’ve been scanning the openGL 3.0 spec and a lot of mails and it seems to be the plan the selection and feedback modes are removed from openGL in the near future.
My question is: how can I achieve that functionality once they are gone? For some of the removed functions the spec states the proposed replacement but there is no mention of how I am supposed to find out what is below the mouse once openGL 3.x is there. I tried to find an answer to this in several forums but I could not find anything…
This isn’t something for a graphics API imo, it should never have been in GL in the first place.
You can render each object with an unique color, then read back the pixel under the mousepointer with glReadPixels. Keep in mind that the spec doesn’t guarantee that the rasterized color is the exact same value you passed to glColor3f, but you can take this in account by allowing a margin.
For feedback you can use the transform feedback (render to VBO) functionality. For selection: so it yourself. There are lots of ways, like manual raycasting or using occlusion queries, or the unique-color-id as remdul suggested.