Controlling lighting

If I understand correctly a light node in a scene graph lights up all nodes within its influencing bounds. Let’s say there is a wall between a light and an object, then obviously the light shouldn’t light up the object. How can explicitly specify which objects a light influences?

And if there is a hole in the middle of the wall, then light should shine through hole, doesn’t it ? You should look up the subject of shadows, not limiting light influence. In other case you are bound to find unrealistic artifacts all the time.

On the other hand, if you just want to have per-room lighting, on/off, then you should manage light influence per hand - there is no way in which engine could know where do you want to put boundary.

I can calculate which lights influence which objects using my game engine. I just wonder how to specify in Xith3D which lights should be taken into account when rendering an object.

I would appreciate if someone could give some hints on this subject as it’s an important criteria for my usage of Xith3D.

As far as I’ve seen the only control you have with lighting in Xith is that the light only effects the things in the branchgroup its in.

So your only hope with your scenario is to branch group things based on lighting.

It might be time to update Xith to support influencing bounds (or better still, EffectedNodes)

Hopefully someone will tell you in a moment that I’m wrong and you can do it in XYZ way…

Kev

I’m not sure I understand. I thought I read that lighting is supposed to affect everything in the scene graph under it… but the scene graph hierarchy is how the light is positioned in the first place… ie, World -> Player -> RightArm -> Torch -> LightSource. But how is the LightSource at the end of the arm simutaneously be able to light the World node… unless, I guess, you kept a matching twin… like a placeholder object at the end of the torch, calculated its world position, and then updated a real light in the World node to match or something… but that sounds pretty ineffecient.

To quote the Java 3D tutorial:

“The influence of a light object on the world is not affected by the light object’s position in the scene graph;
however, the bounds object referenced by the light is.”

So, in Java 3D you can place a light node anywhere in the graph (for example in the hand of a creature) and it will influence all things inside its influencal bounds. This is logical and good default behaviour. I hope that Xith3D works the same way.

I want to place light nodes in their natural place in the scene graph (for example, the hand of a creature), but I want to explicitly specify to Xith3D which graph nodes this light influences. Xith3D should then correctly turn on/off OpenGL lights for an object when rendering the scene.

If this isn’t possible to do with Xith, I’ll have to create my own scene graph (which I might do anyway :), but whatever).

Lights don’t work that way in Xith I’m afraid. Maybe it should be changed?

Kev

[quote]So, in Java 3D you can place a light node anywhere in the graph (for example in the hand of a creature) and it will influence all things inside its influencal bounds

I want to place light nodes in their natural place in the scene graph (for example, the hand of a creature), but I want to explicitly specify to Xith3D which graph nodes this light influences
[/quote]
I think this hits the nail on the head exactly. Of course you could always make a new type of light that provides this capability without breaking the existing lighting system.

Also, please don’t tell me that Xith uses OpenGL lights… because last I heard, OpenGL had some unreasonably low limit to the number of lights available (like 8 or something) and my scene may have hundreds… how many are dependent on performance, of course, but I’d rather be limited by performance than by some artificial tiny limit.

Oh, I thought Xith3D tried to emulate Java3D. What is the reason for changing the behaviour of such a fundamental thing as lights? ???

I think being able to place the light source in its natural place in the scene graph (for example in a hand) is a good thing. Specifying which nodes are influenced by a light could be done in two ways:

  1. The light node contains a list of the nodes it influences.

  2. A group can contain some kind of light reference leaf which references the light node. All child nodes of this group are then influenced by the light.

I think solution 2 is similar to the current light behaviour and probably requires less changes in the rendering classes.

8 simultaneously used lights for each triangle array should be enough for all applications, but there should be no restriction on the number of light nodes in the scene graph. The rendering classes should pick the 8 (or less) most influencal lights to use for each object. The max number of lights to use at the same time should be configurable in the renderer.