[SOLVED]Lightmap + spotlight is this normal?

Hi. Is it not ok to use a lightmap and a spotlight? I ask as I am getting

1 ambientlight at ColorRGBA.White.mult(0.5)
Lighting.j3md (stock)
use material colours true, 1,1,1,1 for all
diffuse texture + lightmap nothing else

(I know it looks funny but I’m just testing stuff atm so it looks exactly as expected, lightmap just using wrong UV atm as intended)

When I add a spotlight, with Color.RGBA.White (no mult)
Spotlight inner angle is 10degrees (multiplied by DEG_TO_RAD in code)
outer angle is 20degrees
simple update:
sl.setPosition(new Vector3f(cam.getLocation()));

I get

Anything outside the spotlight reverts to what I would get if I had no lightmap at all and only the ambient light

If it’s as simple as “don’t use lightmaps with dynamic lights” then I get it. Kinda figures I guess. Just wanted to check I wasn’t making some blunder. My intention was to use relatively dim lightmaps combined with a torch type light.

looks like your inner and outter angles are inverted, could you double check?

sl = new SpotLight();

I tried reversing it just to see what happened aswell


Same problem in reverse

Well… the light kinda cancels the lightmap… do’nt you have that with other light types?

Nope, well not with point.

This is just a pointlight with my lightmap and diffuse but no ambient (made pointlight red to make difference between it and ambient effect on lightmap clearer)

Then here it is with both the pointlight and white ambient light, which is lighting the lightmap

Tbh I’m thinking using projected texture by survivor (Projective Texture Mapping) would probably be better for a torch effect anyway? It’s also come to mind that I’m using a relatively old version of JME 3.0 so perhaps it could just be an issue with my version.

So if anyone has the same problem and comes across this:

Inside the lighting fragment shader, the part for spotlights is done before the diffuseColor is multiplied by the lightMapColor, so a simply cut paste job can pretty much fix it.