Applying multiple textures - lighting


I just started playing with jme, and I love it. But I find multitexturing confusing, and I have a question. How would I generally go about overlaying a texture on top of another texture so that the texture on top replaces the texture on bottom except where transparent, all without overriding lighting values?

I would like to be able to take a texture with transparent sections, apply it, then change the color underneath.

I already tried using the decal apply mode. I also tried using a separate black and white mask with the combine apply mode, but this just had the same effect as the decal apply mode (it overwrote the lighting values). I actually don't understand why it overwrites the lighting values to begin with…

Thanks for reading!

The reason why it overwrites lighting, is because it is modulated in the first texture unit, while the second texture unit is interpolated with the first, where the second is not modulated with lighting. The correct way to do this is more complicated, and requires multitexture combiners.