View Full Version : Color ID picking and antialiasing problem

03-03-2005, 05:09 AM

I'm experiencing a problem using color ID picking and antialiasing: when AA is activated (via the driver pannel), the AA blending is also applicated during the picking rendering, interpolating new values which may differ from the IDs used as color. For exemple:

I render a box with ID 28 (RGBA: 28, 0, 0, 0) near a triangle with ID 32 (RGBA: 32, 0, 0, 0). With AA, I can get a wrong readpixel value (for exemple of 30) where the cube and triangle overlap, due to the AA algorithm.

So: do it exists a way do temporary disable AA through OpenGL during this special rendering phase?
Using a different buffer other than the backbuffer will bypass this issue (like using a render to texture)?
Any other suggestion? (Sorry for my poor english :( )

03-03-2005, 05:49 AM
I had exactly the same problem a while ago. I never found a solution other than the one you suggested.

You cannot temporarily disable aa, and anyway the user can override the application's aa settings via the control panel even if you could.

03-03-2005, 07:50 AM
glDisable( GL_MULTISAMPLE ) works for me (Nvidia FX5700 67.66) but only if I set AA at driver page to "2x" or "4x".
"2xQ" and "8xS" still give some anti-aliazing.

03-03-2005, 08:22 AM
just a stab in the dark, try drawing to another buffer, eg GL_LEFT