[SOLVED] Trouble with getting point lights to work in JME3 SDK SceneComposer

Hi,
I made a .glb model in blender and am using it in jme. However, the lights that I added in blender don’t seem to work in jme. I then added some point lights to the scene. However, they don’t seem to actually light up the planes around them how I expected. Some parts of the model aren’t lit up at all, even if there is a light right next to them. Here is an example:


Either that, or I don’t understand how lights work in jme3.
Thanks in advance.

In JMonkeyEngine, a light illuminates only the geometries descended from the spatial to which the light is added.

To illuminate an entire scene, you’d add light(s) to the root node.

1 Like

Isn’t the Scene the rootNode? All the geometries are under the scene, as well as the lights.
image
When I disable the light, one of the walls is lit. When I enable the light, however, it turns dark. Why is this happening?
Also, is it possible to get the lights from the blender model working in jme?

Does your scene light up if you click the global light icon:
image

Or is it still dark?

1 Like

Unfortunately, no. It lights up the room to the right, but that was already lit up.

Then there is something wrong with the geometry. Probably the normals are pointing in instead of out or something. Check the normal direction in blender or just regenerate normals and try again.

2 Likes

It looks fine in blender. Also how do you check normal direction? I used an image for the normal for the brick texture that I got from textures.com

A normap map also needs regular vertex normals (and tangents) or it won’t know where to point things. Lighting = normals. No mormals, no lighting. Inseparable.

Probably if you google “blender normal directions” you will get a few thousand hits.

Edit: re:

Yes, well Blender can render effects for feature films… but they aren’t going to work in a game. Geometry needs to be put together correctly for game engines.

2 Likes

Thanks. I found out how. You were right. My normals were facing the opposite direction.

2 Likes

@Randamixer was this using the beta for jme 3.4.0?
As of 3.4.0 lights exported from blender with gltf format will get imported as long as they were exported with the lights punctual gltf extension (an option in blender on the export page)

No, I was using v3.3.0. Thanks for the info though!

2 Likes