Hi Opengl Gurus,
I’m attempting to get color picking working on parts of a skinned character. I have color pick 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 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.
Is there a way to make the pixel shader pick the color of the nearest vertex instead of interpolating, or another method that might work?
ps. a posting on a different board got the suggestion of setting glShadeModel(GL_FLAT);
which forces the triangle to be one of 3 colors with out interpolation, not perfect but I think what I was looking for.