Light problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
StickyBit
Posts: 94
Joined: Mon Jul 05, 2004 3:40 am
Location: Sønderup, Denmark
Contact:

Light problem

Post by StickyBit »

Hi Guys

I´m having a small light problem. The problem is that light shines through faces. In the following example the lightsource is a small sphere near the surface - and this lightsource emits light onto the shown face on top of the tower - through the tower walls:

Image

The light code used is more or less the light code from example 8. Could you pleae tell me where to look for this error?

Regards StickyBit
Last edited by StickyBit on Tue May 09, 2006 7:58 pm, edited 1 time in total.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

It seems the tower mesh is set to unlit ???
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
StickyBit
Posts: 94
Joined: Mon Jul 05, 2004 3:40 am
Location: Sønderup, Denmark
Contact:

Post by StickyBit »

Hi Acki

Thanks for your answer - but I must say that I do not understand it. If you look at this picture you will see that the tower is lit by the sphere:

Image

I´ve set the EMF_FOG_ENABLE material fog for the tower mesh and it´s working fine along with the general lightning - except the problem with light going though the mesh faces, and cuz´s of that - faces that shouldn´t be lit, is now beeing lit.

Regards StickyBit
Last edited by StickyBit on Tue May 09, 2006 7:58 pm, edited 1 time in total.
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

did you set the EMF_LIGHTING_ENABLE flag to true?
The Robomaniac
Project Head / Lead Programmer
Centaur Force
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

You can see the water is litten by the light node but the tower doesn't change its surfaces on the light node...
Also the ground and bridge doesn't lit up by the light...

(if I see right ;) )

Did you set up the nodes with node->setMaterialFlag(EMF_LIGHTING, true) ???
With (EMF_LIGHTING, false) they will not be affected by the light node...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
StickyBit
Posts: 94
Joined: Mon Jul 05, 2004 3:40 am
Location: Sønderup, Denmark
Contact:

Post by StickyBit »

The EMF_LIGHTING flag is set to true .. and lightning does work "fine". The reason for that it´s hard to see the bridge and grass being lit - is that it´s lit all the time. This is all happening cuz´ the tower faces both reflect light and lets light pass through.

This means that the bridge and grass is lit even when the sphere is located behind the tower.

I guess that the real question is: How do I stop light from passing through the tower?

By the way .. The Irrlicht SpecialFX example is having the same problem. In the following screenshot you can see the water being lit through walls:

Image

Regards StickyBit
Last edited by StickyBit on Tue May 09, 2006 7:59 pm, edited 1 time in total.
Mazer
Posts: 16
Joined: Sat Jun 19, 2004 12:21 pm

Post by Mazer »

If I'm not mistaken, there should be an option for setting the lightscenenode to cast shadows. I just had to do a clean install of windows and haven't yet downloaded irrlicht so I can't check the API for you. But I'm pretty sure it's there!
ours_kodiak

Post by ours_kodiak »

the shadow is the only solution but you've got to make shadow for each node and a selfshadowed (i don't know if the word exists) object doesn't give good result ...
Post Reply