question about lights in the panda scene graph

hello,

while i was browsing the panda3d manual about lights and lighting
(here http://www.panda3d.org/manual/index.php?title=Lighting&language=cxx )

I was wondering why we have to attach the light to the scene like shown in the example.

PT(DirectionalLight) d_light;
d_light = new DirectionalLight("my d_light");
NodePath dlnp = window->get_render().attach_new_node(d_light);

but we still got to tell each object (or root nodes) which iights affect the objects(nodes)

window->get_render().set_light(pnlp);

and/or

sofa.set_light(plnp)

how come the light needs to be added to the scene graph at all ? (this question is out of curiosity about how the panda scene graph interacts with lights )

chrys

Actually I think I found the answer in the manual page itself.

Is it purely because of the positioning relative to a scene ? So for convenience its just re-using the scene graph.
and the reason why we have to set the light on the objects is because we could have several lights but might want to limit the calculations they perform to a subset of nodes.

makes sense :stuck_out_tongue: