I have a doubt here. I render around 500/600 triangles within gl SELECTION mode. Does this increase the time spent ?. If I render the same in RENDERING MODE and measure the time, it takes <= 1 ms. and if I do the same rendering in SELECT mode just before calling the HITS, it takes 6 ms (only the rendering piece of code). am I doing any mistake, where it would be?..I am getting a correct clipped output!!
timer is a high performance counter, don’t doubt it !!
I don’t know whatz happening ? please throw in ur COMMENTS…any help is appreciated…
Selection is done via software rendering. So, yes, it is going to be slow.
Software Rendering, what does that mean?. How does that differs from normal RENDERING mode of OpenGL.
Originally posted by taurean:
[b]Software Rendering, what does that mean?. How does that differs from normal RENDERING mode of OpenGL.
Selection in software can be done in a variety of ways. For example, casting a ray into a retained-model world and collecting and sorting the hits.
In the case of OpenGL, with its name stack, it may be implemented more as a very small viewing frustum, where anything outside that frustum is thrown away (on the CPU) and the the triangles that remain are then sorted without need for rasterization.
For faster selection, my suggestion is to use the RENDERING mode of OpenGL, but render to a 1x1 pixel area with object tags instead of colors (no lighting, texturing, antialiasing, blending, or color-warping of any sort). Doing a 1 pixel readback is fast enough now to make this practical.
This will at worst take the same amount of time as rendering your scene normally but can be substantially faster in most cases, both in fill and also geometry if you can do some coarse culling first.
What you don’t get with this approach is a list of hits. You only get the closest, which, fortunately, is usually what you want.
[This message has been edited by Cyranose (edited 11-16-2003).]
Thanks for your comments. Can you cite any document or source that SELECT MODE in OPENGL has this performance drawback ?
For my application, I need a list of hits. I found in a paper that uses SELECT MODE and achieves such a clipping in less than 2ms for a list of 1000 triangles. i had given the link of a paper dealing with collision detection, if ur confused, just read the results () and the timing diagrams, very easy to READ…they had used SELECTION & PICKING…, need your comments!!..