Page 1 of 1
Irrlicht and light picking
Posted: Wed Mar 04, 2015 5:26 pm
by The_Glitch
I have a strange issue with a shader that only uses one point light. I noticed if my app has more than one light else where in the scene the above issue in the video occurs as if it's having a hard
time selecting which light to use or stick with. Though in the shader callback I tell Irrlicht to use
Code: Select all
SLight light;
light = driver->getDynamicLight(0);
core::vector3df light_position = light.Position;
Only the first light. If I remove the second light and only have one light in the scene everything seems to work fine.
Re: Irrlicht and light picking
Posted: Wed Mar 04, 2015 5:35 pm
by thanhle
Can't view your video as it is private.
Regards
thanh
Re: Irrlicht and light picking
Posted: Wed Mar 04, 2015 6:06 pm
by The_Glitch
Sorry should have been public, I have to reload accidently deleted the duplicate upload check back later if you can I'll update the link.
Re: Irrlicht and light picking
Posted: Wed Mar 04, 2015 7:27 pm
by The_Glitch
Re: Irrlicht and light picking
Posted: Thu Mar 05, 2015 12:32 am
by The_Glitch
I see I've trumped the community once more lol
Re: Irrlicht and light picking
Posted: Thu Mar 05, 2015 1:19 am
by mongoose7
It's a shader problem and you didn't post your shader code. What do you expect?
Re: Irrlicht and light picking
Posted: Thu Mar 05, 2015 2:24 am
by The_Glitch
I'm currently checking both ends I'll post the shader also.
Re: Irrlicht and light picking
Posted: Wed Mar 25, 2015 7:04 am
by BlindSide
I don't think it's the shader, Irrlicht will update the list of dynamic lights every frame based on which light picking strategy is used. If you want to stick with one light you can maybe just get the position from the ILightSceneNode instead.
Re: Irrlicht and light picking
Posted: Wed Mar 25, 2015 3:04 pm
by The_Glitch
Yeah I already knew it was a Irrlicht side problem. I'm not sure why people always say it's a shader problem. If I only have one light in the scene the shader works as expected.
Re: Irrlicht and light picking
Posted: Thu Mar 26, 2015 1:27 am
by mongoose7
Irrlicht's handling of lights only becomes an issue if you have more than eight lights. I thought you had two! It sounds like *your* problem to me.
Re: Irrlicht and light picking
Posted: Thu Mar 26, 2015 1:32 am
by thanhle
Hi,
Last time I remember, the light switching occurs at some angle range even if you have less than 8 lights. That was the version in trunk.
I think there is a bug introduced somewhere between the version.
It could also be the normal or tangent of the model is not right.
May be test a different mesh by putting in the same location and orientation to see it is the same? Static a well as dynamic mesh.
Regards
thanh
Re: Irrlicht and light picking
Posted: Thu Mar 26, 2015 2:28 am
by The_Glitch
@mongoose7
If you say so. Right now I'm trying to overcome an issue in shader-pipeline right now.