Skip to main content
GameDev.net gamedev.net
🔒 Locked

About selection and feedback

Started by OpenGL_VC Sep 7, 2005 at 2:13 AM 1 replies 550+ views
Original Post
OpenGL_VC
OpenGL_VC
OK,I know that we can use the selection and feedback method to pick the Object , But I don't know what it was in the selectBuffer after feedback.(GLuint selectBuf[BUFSIZE];) I mean what it is the buffer compose by? Oh,Forgive my poor English.
jmaupay
jmaupay
GLuint selectBuf[BUFSIZE]; gives the picked objects id (=name in OpenGL).
When you render your scene for picking, you have to affect at each object you want to able the picking an id (int), using glLoadName() ;

There is an example in glut: Glut\progs\demos\gliq
jma
Mantear
Mantear
If you're using the selection buffer for picking purposes, and you aren't stacking names by pushing/popping, it should look something like this:

selectBuf[n+0] = 1, indicating no pushing/popping is going on
selectBuf[n+1] = minimum Z value
selectBuf[n+2] = maximum Z value
selectBuf[n+3] = name

I'm not familiar with the feedback mode, so if that's what you're looking for, disregard what I just said.

However, be warned: using the selection buffer [glRenderMode(GL_SELECT)] on ATI cards will have very poor performance results if the number of triangles being drawn is more than trivial. I believe the same applies when using it for feedback. I contacted ATI about it with little/no response. It works fine on NVidia cards, though.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.