GL_SELECT slow on ATI x800

I am using OpenGL selection mode (GL_SELECT) to do simple picking with the mouse. We are picking on a model with around 30K polys. Everything works fine and is fast on and older NVidia GeForceFX 5200 card, but when we run the same code on a new ATI Radeon X800 card the picking takes a long time to return. It looks like the re-render of the geometry in selection mode is being done in software.

Are there any known issues with using OpenGL selection on new ATI hardware?

TIA,
Malachi

Here is the code…

// Perform the OpenGL selection
GLuint	iBuffer[BUFSIZE];   // selection iBuffer
GLint	iHits;              // number of objects that were selected

// Get the viewport for this channel
GLint iViewport[4];
glGetIntegerv(GL_VIEWPORT, iViewport);

glSelectBuffer (BUFSIZE, iBuffer);  // specify the selection buffer
(void) glRenderMode (GL_SELECT);    // switch to selection mode

glInitNames();                      // initialize the name stack
glPushName(0);

// Setup the Projection matrix
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();

// Create a matrix that is zoomed into the portion of the screen around the cursor
gluPickMatrix((GLdouble)fX, (GLdouble)(iViewport[3]-fY), 1.0f, 1.0f, iViewport);

// Apply the Perspective matrix
glFrustum(m_fFrustumL, m_fFrustumR, m_fFrustumB, m_fFrustumT, m_fFrustumN, m_fFrustumF);

// Setup the ModelView matrix
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
m_pChannel->getCamera()->changeView();
gluLookAt( m_kCameraPos[0], m_kCameraPos[1], m_kCameraPos[2], // camera position
           kLookAt[0], kLookAt[1], kLookAt[2], // look at position
           m_kUp[0], m_kUp[1], m_kUp[2] ); // up vector

// Render the scene to the selection buffer
m_pDrawTraversal->update(m_pPickRootNode);
m_pDrawTraversal->draw();

// Put things back to the way they were
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();

iHits = glRenderMode(GL_RENDER);    // switch back to render mode

// Determine what was selected...

AFAIK, selection mode isn’t accelerated at all.

On ATI cards make sure your objects are not compiled (VBOs for instance) and you should be getting a healthy speed boost.

Because of the speed problems with GL_SELECT, I do now use an fbo-item-buffer for selection purposes. Works beautiful and hw-accelerated :slight_smile:

Since selection is not accelerated does that mean ATI would rather we not use it on their hardware or is the software fallback fast enough that it should still be usable? When making a modelling application should I write my own 3D picking code for use on ATI hardware?

Thanks

Malcolm

I turned off VBO’s and rendered using regular vertex arrays only and then everything works fine on the ATI x800. So, I guess GL_SELECT and VBOs don’t play well together on this card. Strange. Thanks for the help. -Malachi