View Full Version : Feedback and depth buffer.
10-27-2004, 01:17 AM
I am trying to implement feedback in my animation program to allow user to select points on a mesh. I have got it to work so that the user can draw a box in the workspace and it will select all the points that fall under that box. The problem is that ALL points under the box, including those not visible to the user (i.e. occluded) get selected.
The feedback scene is drawn by first ensuring that depthbuffering is ON, that polygon draw mode is fill on both sides and then drawing the mesh as polygons. I then draw all the points that need to be selectable with a slight offset towards the camera (to overcome depth buffer inaccuracies) and use passthrough values with these points to create the correct feedback. But I am getting feedback even for the points that aren't being drawn! How can I fix this?
10-27-2004, 03:30 AM
You use feedback instead of picking ?
From the man pages :
"When OpenGL is in feedback mode, no pixels are produced by rasterization. Instead, information about primitives that would have been rasterized is fed back to the application using OpenGL."
So all the raster stage operations like blending, depth test and such, are not performed.
For your case, you need picking (or other raster method) as well as feedback.
10-27-2004, 03:45 AM
also from the manual:
"The values sent back to the feedback array consist of tokens that specify what type of primitive (point, line, polygon, image or bitmap) has been processed and transformed, followed by vertex, color, or other data for that primitive. The values returned are fully transformed by lighting and viewing operations."
"In feedback mode, each primitive that would be rasterized (or each call to glBitmap(), glDrawPixels() or glCopyPixels(), if the raster position is valid) generates a block of values that's copied into the feedback array."
Hardly clear is it? Specially where it says "The values returned are fully transformed by lighting and viewing operations.", kinda indicating that they will have been tested for visibility.
Also as far as selection is concerned:
"..., OpenGL returns a list of the primitives that intersect the viewing volume."
That would indicate that whether the object would be occluded by another object is irrelevant.
So unless you are telling me you have done this or can point to a definite source, and that object occlusion IS taken into account then I can't afford to spend time writing the code (unless I really run out of options).
Thanks for the reply though.
Funny I can't find any sources where some1 talks about selected points on a mesh.
10-27-2004, 03:57 AM
okay after a quick look in a few places, what you say does make sense. can't find anywhere that says that selection mode DOES rasterize, but everywhere says that feedback doesn't, so I will try selection instead.
10-28-2004, 12:41 AM
Well i get exactly the same results with selection but at least I got it to work which is more that I have managed before.
Any ideas as to how I can use feedback with selection to pick only non occluced points?
My selection allows the user to draw a rectangle on the screen and then the selection status of every item within the rectangle is inverted (i.e. selected objects are deselected and viceversa).
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.