   Picking a skinned character
  Hi Opengl Gurus,I'm attempting to get color picking working on parts of a skinned character. I have color picking working on parts of my scene, however it's currently limited to rigid objects, or an entire skinned character. I'm interested in the nearest bone to the clicked location.I'm using GLSL to do the skinning, and I'm able to hand the vertex shader a uniform array that can act as a lookup table (bone index to color). The vertex shader can then color each vertex with color of the bone with the maximum weight influence (see image). The problem is that the pixel shader interpolates between the various colors. Making picking the area around the joints impossible. see: shader_comparison.jpgIs there a way to make the pixel shader pick the color of the nearest vertex instead of interpolating, or another method that might work?thanks,-Gedalia   
  then you might want to use ray picking.ok, why do you decide to use the color that is related to the nearest bone id for picking.if i were you, and if i want the user to pick up triangles, i will give each triangle an unique id.if i want to pick up points, i will give each points an unique id.then rendered color will only be determined by the unique id. in this case, picking each primitive will be possible.it seems to me that you're mixing the color that should be used for picking with the color indicating the nearest bone.so why not use two sets of colors, for picking, just give each primitive a different color and then use another table to indicate which vertex is near which bone.well, i probably misunderstand your question.   ;  glShadeModel(GL_FLAT) disables color interpolation. But then you will have another problem, if three adjacent vertices have 3 different colors, only one color will be applied to the triangle. Giving each triangle a unique color is the way to go.   ;  Well I'm not actually trying to identify each triangle just each bone. I'm not doing CAD/CAM work, I am trying to distinguish between a head shot and a shot to the leg.  glShadeModel(GL_FLAT) Actually isn't bad if your willing to accept imperfect results. Thanks deathkrush   