[SOLVED] Jme3 Beginner: Lighting and Material

This might be a really basic question. I’m a newbie so bare with me :slight_smile:



I use a DirectionalLight to project light on my scene. I have a question that would help me understand the light concept better in jme (and graphics in general).



I understand the a DirectionalLight is just like a sun (“infinitely” far away and sends out parallel beams of light equally to the scene). However when my spatial rotates, the light fades away and the spatial becomes black. I am assuming it has to do with the perspective of my camera. How can I fix this?



Thanks in advance

Maybe your light is attached to your spatial node, so it rotates away? Try adding the light to a node one parent level above your spatial (or the root node)…



Disclaimer: I haven’t worked much with dynamic lighting :smiley:

yeah the light is typically attached to the rootnode, where is yours? Also, they don’t shine very far, maybe your object is too far away? Sometimes I add an additional AmbientLight, to increase the overall brightness.

it is already attached to the rootNode.



a quick hack to fix it was to use the spatial internal material (from Blender) but was curious to know if I placed the object correctly at the beginning compared to the perspective of the camera.

I eventually added a sun covering both faces of my scene and it works fine now. Might b a dirty hack but ehhh it works.