Irrlicht and light picking

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Irrlicht and light picking

Post 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.
Last edited by The_Glitch on Wed Mar 04, 2015 6:07 pm, edited 1 time in total.
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: Irrlicht and light picking

Post by thanhle »

Can't view your video as it is private.
Regards
thanh
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Irrlicht and light picking

Post 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.
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Irrlicht and light picking

Post by The_Glitch »

The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Irrlicht and light picking

Post by The_Glitch »

I see I've trumped the community once more lol
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Irrlicht and light picking

Post by mongoose7 »

It's a shader problem and you didn't post your shader code. What do you expect?
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Irrlicht and light picking

Post by The_Glitch »

I'm currently checking both ends I'll post the shader also.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Re: Irrlicht and light picking

Post 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.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Irrlicht and light picking

Post 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.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Irrlicht and light picking

Post 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.
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: Irrlicht and light picking

Post 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
Last edited by thanhle on Thu Mar 26, 2015 2:29 am, edited 1 time in total.
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Irrlicht and light picking

Post by The_Glitch »

@mongoose7
If you say so. Right now I'm trying to overcome an issue in shader-pipeline right now.
Post Reply