[SOLVED] Some questions about lights and nodes

Hey,



So I have been developing in jmonkey for about six months now, and I am getting really familiar with most of the ends and outs of the system. I have built several quick example games with all the common features: audio, animation, shadows, nifty guim, terrain, etc. But I am still very confused about how nodes and lights interact, and about the differences between getLocalLightList() and getWorldLightList().



Here are my questions as best as I can articulate them:


  1. When I add a light to the rootNode, do all nodes under rootNode see that Light in getLocalLightList()?


  2. When I add a light to a sub-node does that light render only on the items within that node?


  3. If I add the same light reference to two different nodes will that light then appear on both of them?



    and I have a final off topic node question:


  4. If I create an geometry; and then attach that geometry to two sub nodes; and then attach those two sub-nodes to the rootNode; will there be two instances of that geometry within the rootNode?



    Thank you for taking some time to help me.



    -Carter12s
  1. No. You have to get the world light list
  2. Yes
  3. Not sure about that, i guess it sticks to the last node it was attached too. Tho not sure…
  4. No a geometry can have only 1 parent node, so you cannot add that geometry to 2 nodes at once, only if you clone it.



    Check this out: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_node
1 Like

Thanks for the reply, cleared up most of my questions.