So I wrote prepareForSoftware() as follows. Trouble is I'm sensing that the order of the operations is wrong. It's currently going:
texInfo = new TextureInfo(tm.getTextureID("EnvironmentMap"));
texInfo.add(tm.getTextureID("Starfighter.png"), TextureInfo.MODE_ADD_SIGNED); //MODE_ADD, MODE_BLEND, MODE_MODULATE, MODE_ADD_SIGNED
in the constructor. Then, once it's been established that the renderer in use is software:
public void prepareForSoftware() {
TextureManager.getInstance().addTexture("GreyBump", new Texture(1024, 1024, new java.awt.Color(128, 128, 128)));
body.setBlending(true);
texInfo.add(TextureManager.getInstance().getTextureID("Starfighter.png"), TextureInfo.MODE_ADD_SIGNED);
texInfo.add(TextureManager.getInstance().getTextureID("GreyBump"), TextureInfo.MODE_ADD_SIGNED);
}
No go. On the other hand:
public void prepareForSoftware() {
TextureManager.getInstance().addTexture("GreyBump", new Texture(1024, 1024, new java.awt.Color(128, 128, 128)));
body.setBlending(true);
texInfo = new TextureInfo(TextureManager.getInstance().getTextureID("Starfighter.png"));
texInfo.add(TextureManager.getInstance().getTextureID("EnvironmentMap"), TextureInfo.MODE_ADD_SIGNED);
texInfo.add(TextureManager.getInstance().getTextureID("GreyBump"), TextureInfo.MODE_ADD_SIGNED);
body.setTexture(texInfo);
}
produces a very similar effect to my combineAmbientAndDiffuse() method (the diffuse information is not in the right place but the environment map, tinted by the diffuse color, behaves right).