Problem with textures

Ok, I recently tried to use nifty-gui, but I had a lot of trouble and strange errors with it, so I decided to move on to another GUI.



This time, I'm trying TWL. This one also directly uses LWJGL libraries and seems very good.

Yet I'm having a weird error.

It seems like it's not specific for this kind of GUI, but also in general concering rendering textures.



I have set up a random terrain, and then added a button on the top left to see if it would work.



Now I apply a texture to the terrain:

      
        ProceduralTextureGenerator pt = new ProceduralTextureGenerator(heightMap);
        pt.addTexture(new ImageIcon(SimpleSetup.class.getClassLoader().getResource(
                "jmetest/data/texture/grassb.png")), -128, 0, 384);
        pt.createTexture(512);

        TextureState ts = display.getRenderer().createTextureState();
        ts.setEnabled(true);
        Texture t1 = TextureManager.loadTexture(
                pt.getImageIcon().getImage(),
                Texture.MinificationFilter.Trilinear,
                Texture.MagnificationFilter.Bilinear,
                true);
        ts.setTexture(t1, 0);
        terrainNode.setRenderState(ts);



I draw my 3D terrain and my button, and everything seems fine (don't mind the weird looking grass texture, its a bit messed up but that doesn't matter here):





Now, if I want to make some more advanced textures using the following code:


        ProceduralTextureGenerator pt = new ProceduralTextureGenerator(heightMap);
        pt.addTexture(new ImageIcon(SimpleSetup.class.getClassLoader().getResource(
                "jmetest/data/texture/grassb.png")), -128, 0, 384);

        pt.createTexture(512);

        TextureState ts = display.getRenderer().createTextureState();
        ts.setEnabled(true);
        Texture t1 = TextureManager.loadTexture(
                pt.getImageIcon().getImage(),
                Texture.MinificationFilter.Trilinear,
                Texture.MagnificationFilter.Bilinear,
                true);
        ts.setTexture(t1, 0);

        Texture t2 = TextureManager.loadTexture(
                Demo.class.getClassLoader().getResource("jmetest/data/texture/Detail.jpg"),
                Texture.MinificationFilter.Trilinear,
                Texture.MagnificationFilter.Bilinear);

        ts.setTexture(t2, 1);
        t2.setWrap(Texture.WrapMode.Repeat);

        t1.setApply(Texture.ApplyMode.Combine);
        t1.setCombineFuncRGB(Texture.CombinerFunctionRGB.Modulate);
        t1.setCombineSrc0RGB(Texture.CombinerSource.CurrentTexture);
        t1.setCombineOp0RGB(Texture.CombinerOperandRGB.SourceColor);
        t1.setCombineSrc1RGB(Texture.CombinerSource.PrimaryColor);
        t1.setCombineOp1RGB(Texture.CombinerOperandRGB.SourceColor);


        t2.setApply(Texture.ApplyMode.Combine);
        t2.setCombineFuncRGB(Texture.CombinerFunctionRGB.AddSigned);
        t2.setCombineSrc0RGB(Texture.CombinerSource.CurrentTexture);
        t2.setCombineOp0RGB(Texture.CombinerOperandRGB.SourceColor);
        t2.setCombineSrc1RGB(Texture.CombinerSource.Previous);
        t2.setCombineOp1RGB(Texture.CombinerOperandRGB.SourceColor);

        terrainNode.setRenderState(ts);

        FogState fs = display.getRenderer().createFogState();
        fs.setDensity(0.0015f);
        fs.setEnabled(true);
        fs.setColor(new ColorRGBA(0.5f, 0.55f, 0.5f, 0.5f));
        fs.setDensityFunction(FogState.DensityFunction.Exponential);
        fs.setQuality(FogState.Quality.PerVertex);
        terrainNode.setRenderState(fs);



then the button looks like this:




It seems like the texture used for the terrain is somehow passed through to the GUI element(s). Does anyone know how this is caused, why it only happens with combined textures and how I could possibly counter it?

EDIT: another weird fact I just discovered: if I turn the camera so that nothing of the terrain is vibisle at all, the button gets drawn correctly (without the weird texture on it).

Thanks in advance

- Mike