Trouble with Lighting

Hey Guys,

I made some progress and wanted to have some cool lighting.

Here you can see some PointLights imported from Blender (way too intense, the importer misses that out).

Question a: Lights aren’t as Spatials in the SceneGraph, right? So the SceneGraphVisitor won’t work to adjust the brightness? I need rootNode.getLocalLightList() but I’d want it to be global (i.e. every light in the scene).
Can Lights have userData or not (because they aren’t Nodes?)

Question b: As you can see the characters are black. If I add a DirectionalLight they look fine. Why don’t the PointLights illuminate them?

If i interpet your scene correctly:

  1. Game engine simulate not illumination (well most at least) due to performance
    → If the lights are behind your character it is pitch black
    → Always have a dark ambient light in your scenes

You can use it , just by doing for every visited spatial the get LocalLightList()
→ You visit each spatial and in each spatial each light → so all in scene

I dont know if they can have userdata, but if not i guess you could add them to a node wich has userdata.

My guess is you have your PointLight in a node that contains the room. The node that contains characters does not contain this PointLight. When you attach a directional light I guess you attached it to your rootNode or at least the character node or its parent. What I would do is put the PointLight in a node that is parent to both the character and the room. eg rootNode

1 Like

You are awesome guys.
I’m not at home but I am sure it’s because the character is not part of the roomnode.
thanks :smile: