Hmm. I remember having experienced texture oddities regarding mipmap settings on higher texture units a while ago. That might well have been my fault. But this time, I suspect it's a bug either in my graphics card drivers, or maybe the Texture class…
This:
protected void simpleInitGame() {
String shader =
"uniform sampler2D tex0, tex1, tex2, tex3, tex4;" +
" void main(){" +
"vec2 tc0 = vec2(gl_TexCoord[1].x, gl_TexCoord[1].y);" +
"vec2 tc1 = vec2(gl_TexCoord[0].x, gl_TexCoord[0].y);" +
"vec4 result = texture2D(tex0,tc0);" +
"vec4 col0 = texture2D(tex1, tc0);" +
"vec4 alp0= texture2D(tex2, tc1);" +
"result = mix(result, col0, alp0.r);" +
"vec4 col1 = texture2D(tex3, tc0);" +
"vec4 alp1= texture2D(tex4, tc1);" +
"result = mix(result, col1, alp1.r);" +
"gl_FragColor = result * gl_Color;" +
"}";
GLSLShaderObjectsState so = display.getRenderer().createGLSLShaderObjectsState();
so.load(null, shader);
so.setUniform("tex0", 0);
so.setUniform("tex1", 1);
so.setUniform("tex2", 2);
so.setUniform("tex3", 3);
so.setUniform("tex4", 4);
so.setEnabled(true);
Quad mesh = new Quad("mesh", 10, 10);
mesh.copyTextureCoords(0, 0, 1);
mesh.setRenderState(so);
TextureState ts = display.getRenderer().createTextureState();
Texture t0 = TextureManager.loadTexture(
ClassLoader.getSystemResource("jmetest/data/texture/Decal.PNG"),
Texture.MM_LINEAR_LINEAR, Texture.FM_NEAREST);
ts.setTexture(t0, 0);
Texture t1 = TextureManager.loadTexture(
ClassLoader.getSystemResource("jmetest/data/texture/highest.jpg"),
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR);
ts.setTexture(t1, 1);
Texture t2 = TextureManager.loadTexture(
ClassLoader.getSystemResource("jmetest/data/cursor/test.PNG"),
Texture.MM_LINEAR_LINEAR, Texture.FM_NEAREST, 0, true);
t2.setWrap(Texture.WM_ECLAMP_S_ECLAMP_T);
ts.setTexture(t2, 2);
Texture t3 = TextureManager.loadTexture(
ClassLoader.getSystemResource("jmetest/data/texture/highest.jpg"),
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR);
ts.setTexture(t3, 3);
Texture t4 = TextureManager.loadTexture(
ClassLoader.getSystemResource("jmetest/data/cursor/test.PNG"),
Texture.MM_LINEAR_LINEAR, Texture.FM_NEAREST, 0, false);
t4.setWrap(Texture.WM_ECLAMP_S_ECLAMP_T);
ts.setTexture(t4, 4);
mesh.setRenderState(ts);
rootNode.attachChild(mesh);
lightState.setEnabled(false);
}
Yields the following result on my geForce 7400FX(mobile):

Note that the upper white pixels (it's an arrow, actually), are applied both sharp (FM_NEAREST), and clamped to the edge. (Yes, FM_NEAREST implies that, but it's also the case if i set FM_LINEAR)
The lower arrow, however, while applied with exactly the same settings (it's the "test.PNG" texture in texture unit 4), seems to use FM_LINEAR as well as WM_WRAP_S_WRAP_T. What's going on here? Is this my just punishment for tooling with glsl of which I know so little, or could it be actually a bug? If so, where? jME, lwjgl, graphics driver?
Could anybody please try the code, and tell me if they experience the same symptoms? All you need is the provided simpleInitGame() method, dropped into your everyday SimpleGame template :)