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:
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.
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:
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.
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...
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:
Regards StickyBit
Last edited by StickyBit on Tue May 09, 2006 7:59 pm, edited 1 time in total.
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!
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 ...