dot3 bump mapping kills ambient light

title says it all. when i'm using a single texture, the amient light is there. when using these states:

l_bump.setWrap(Texture.WM_WRAP_S_WRAP_T);
    l_bump.setApply(Texture.AM_COMBINE);
    l_bump.setCombineFuncRGB(Texture.ACF_DOT3_RGB);
    l_bump.setCombineSrc0RGB(Texture.ACS_TEXTURE);
    l_bump.setCombineSrc1RGB(Texture.ACS_PRIMARY_COLOR);

    l_texture.setWrap(Texture.WM_WRAP_S_WRAP_T);
    l_texture.setApply(Texture.AM_COMBINE);
    l_texture.setCombineFuncRGB(Texture.ACF_MODULATE);
    l_texture.setCombineSrc0RGB(Texture.ACS_PREVIOUS);
    l_texture.setCombineSrc1RGB(Texture.ACS_TEXTURE);



everything is only lit at actual light sources. how can this be fixed?

The fixed pipeline DOT3 bump mapping in jME emulates lighting so ambient is not taken into consideration. The best thing to do is obviously use a shader to do the whole thing, if that's not possible then you will need to use an empty texture which adds the ambient color into the result:


    emptyTex.setApply(Texture.AM_COMBINE);
    emptyTex.setCombineFuncRGB(Texture.ACF_ADD);
    emptyTex.setCombineSrc0RGB(Texture.ACS_PREVIOUS);
    emptyTex.setCombineSrc1RGB(Texture.ACS_CONSTANT);
    emptyTex.setBlendColor( <lightAmbientGoesHere> );
    texState.setTexture(emptyTex, 2);



Now the effect won't work on cards with less than 3 texture units. All cards I know of with 4+ texture units support shaders, so you might want to just use a shader?
Now the effect won't work on cards with more than 2 texture units

you mean less than 3, right?

so you might want to just use a shader?

the dot3 bump mapping is used for old/weak cards that don't support shaders or simply are too slow.
you mean less than 3, right?

Ah sorry, post edited.

the dot3 bump mapping is used for old/weak cards that don't support shaders or simply are too slow.

In that case you could try doing an ambient pass with additive blend mode to apply the lighting.

your first suggestion doesn't seem to work. do i have to do anything else besides new texture() and copy & paste your code?

I don't syntax check or verify that my code actualy works… I write posts quickly so there's a chance that a couple of errors exist.

In the code I provided I think the only error that is possible is that if you create the empty texture incorrectly, it should be a 1x1 black colored image (generally).