   Masked-Pixel Picking Dilemma
  Hey all,While researching some information for our game engine, a particular problem crossed my mind, which I do not know how to address, or if it's even practical.In our game engine, some objects will be single-quad viewport-aligned-polygon objects (mainly for characters, a la Myth) which can be clicked upon in order to interact with them) whose bitmaps have masked (e.g. alpha test failed) pixels.Since there will be Z ordering of these objects, it would be necessary to know, on a per-pixel basis, which objects are clicked on. However, for example if the mouse were clicked between a character's arm and body (e.g. aimed at the object behind these), without some sort of pixel-perfect hit detection, the character's poly would be returned.OpenGL has selection-buffer rendering which allows you to return the GL name of clicked objects, however if this doesn't take pixel opacity into consideration (and I don't believe it does, but I could be wrong) then it will be useless for my endeavor.Having said that, it sounds like what I must do is something to the effect of, for each viewport-aligned polygon object that intersects a ray cast from the mouse pointer, calculate the location the ray intersects, convert this to 2D coordinates on its respective texture map, check the given pixel's opacity, and if the alpha is greater than 0, return that object's ID; otherwise, continue iteration through the rest of the intersected objects.Ballpark? Wrong league? Wrong sport?   
  Read this thread from this morning.  It confirms your thoughts on the selection buffer and gives a good alternative for pixel-perfect selection.   