Lights...I am in the dark

All

I have an odd lighting problem!! If I place a PointLight in the initial BranchGroup, the one added to the Local, objects in other BranchGroups are illuminated. If I place the Light in a sub-branch group the illumination goes completely away for everything but objects in that branchgroup.

Image a Wall and a Floor, if I put a red and a green pointlight in the top branchgroup, both appear, intermix colors etc. If i put the red light in a separate branchgroup that contains only the floor I get a Green Wall (The toplevel light) and a Red floor (branchgroup local light) with no color mixing…wierd!!!

I just assumed a light was a light was a light no matter where in the heirarchy…any thoughts?? ???

Xith3D lighting model doesn’t work like Java3Ds. The light effects everything in the same branch group as it (and their children).

Kev

What would be the effect of allowing multiple models in a program to have their own light? Would this be too much of an overload for something like 10-12 objects?

If you mean 10-12 lights (as in one per light) as I understand it OpenGL only guarantees 8 lights, so it wouldn’t work on all systems. Other than that I can’t imagine there being too much of a problem with using a bunch of lights. If you’re intending to have one light per unit it might be better to simulate lights (with light maps or something).

Kev

This is not exactly what I am seeing. If I

o put a red light to the uppermost bg,
o load an obj (which returns a bg)
o add a green light to that bg
o add a obj without adding a light to the obj’s bg

                ---bg (green)--model 1

bg (red)-----|
| —bg --model 2
|
----model 3

model(1) has red /green [GOOD]
model(2) is not illuminated [BAD]
model(3) is red [GOOD]

why is model three not getting the red light from the upper bg??
???

previous posting diagram bites, I will try text

main BG contains a red light, model 3 and 2 bg’s (BG1, BG2). BG1 contains a green light and a model 1,
BG2 contains model 2

model1 is lit by the main red and its local green light
model2 is not illuminated
model3 is lit by the main red.

It seems that lower BG’s are only seeing the higher BGs lighting if it also includes a light

:frowning:

Xith3D lighting model doesn’t work like Java3Ds. The light effects everything in the same branch group as it (and their children).

Kev

I am not sure I understand. Should a light in the main BG affect all BGs added to it?? or is it just the non-BG stuff added in the BG containing the light??

In another thread Yuri recently wrote:

[quote]Currently, you do not have to create influence bounds. The light scoping in Xith3D works differently from light scopint in Java3D. In Xith3D, lights are affecting the nodes located under the same group where light is located, including the subgroups. So this is enough if you add your lights to the root scenegraph.
[/quote]

:smiley: Finally figured this out, operator error.

I have numerous walls that are quad meshes, say 10X by 10Y and Z is essentially 0. When a textured mesh is lit, the lighting is viewable from either side, not just the side that the light is on. If a corner is lit with a white light you see the whitish corner when looking from either side…I didn’t expect this. A parallel wall immediately behind the lit wall has no lighting effect because the first wall obscures the light. If you walk between these two walls though, it appears that one is lit and one isn’t, I finally placed a small object at the light location and realized only one wall should be lit. arrgghh