Jump to content
  • Advertisement
Sign in to follow this  
OpenGL_VC

About selection and feedback

This topic is 4760 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!