Bug with Irrlicht 1.8 shadows

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
Nyx Erebos
Posts: 33
Joined: Fri Mar 01, 2013 1:26 am

Bug with Irrlicht 1.8 shadows

Post by Nyx Erebos »

I decided to upgrade to 1.8 and at the same time to stop being dependant to XEffects (even though it helped me greatly) but the shadows make my program bug. I know it's my fault and not some Irrlicht bug because the example 8 runs fine. I can't really post code because I can't narrow the location of the bug. The driver is OpenGL.

When I don't use "addShadowVolumeSceneNode" or "stencilBuffer = true" it works just fine but when I use them both the program loads resources and stops always at the same place. I don't know why it stops at that particular place because it's just an audio loading (with Caudio which is unrelated to Irrlicht AFAIK). Now the funny part, as I said the program stops, it doesn't crash it just stops. Meaning that it still runs but does nothing. Even funnier when I use the KDevelop debugger with stop points, it runs past that audio loading and then does nothing when it reaches the main loop. I'm really puzzled because a couple of time after waiting a few minutes and closing the Irrlicht window, instead of quitting it showed me a frozen screen of my scene with nice shadows, I feel like I'm being trolled :lol: .

If someone has an idea of what I could be doing wrong or how to find where the bug is I would be very grateful :)
Nyx Erebos
Posts: 33
Joined: Fri Mar 01, 2013 1:26 am

Re: Bug with Irrlicht 1.8 shadows

Post by Nyx Erebos »

There were bugs stacking onto each others, now that I dealt with them it works but not very well. I always have that waiting time (Irrlicht needs to load something to compute shadows ?) and when it finally launches the framerate is low and the shadows are a bit bugged. I only have two lights, one attached to a particle emitter and one with a flyCircleAnimator so the performance issue is a bit weird.

Are there any plans on making the lights/shadows work like in XEffects (which was pretty easy to use imo) ? Or are there any good tutorials that show in depth how to use them (with the proper use of SLight innerCone for example) ? Or maybe I should just try to understand how XEffects work and build my own (but I guess it's hard as hell) ?
AReichl
Posts: 270
Joined: Wed Jul 13, 2011 2:34 pm

Re: Bug with Irrlicht 1.8 shadows

Post by AReichl »

try NOT to load or run anything outside of Irrlicht and concentrate on your shadow problem. Does it run when you DON'T load audio?
Nyx Erebos
Posts: 33
Joined: Fri Mar 01, 2013 1:26 am

Re: Bug with Irrlicht 1.8 shadows

Post by Nyx Erebos »

Now it runs but I still have that waiting time at a strange location in my code. Even when I comment out everything audio related it stops at the same place. I don't understand at all what's happening, let's say my main looks like that :

Code: Select all

/*beginning of my main*/
cout << endl << "location1";
cout << endl << "rightNextToLocation1";
/*end of my main*/
It will run until location1 and then wait something like 20 sec and write rightNextToLocation1. I thought it was a weird behaviour from the KDevelop console but when I use an external console it does the same thing but in a different place. Another weird thing is that the last cout before the main loop isn't displayed until the end of the program. If I add other cout it's always the last that isn't displayed.

Edit : is there a way to get more efficient shadows ? Because I only have 2 lights and a few meshes (I think one or two are not low poly but still). When I don't use shadows I get 80fps and 40fps otherwise.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Bug with Irrlicht 1.8 shadows

Post by mongoose7 »

I think you are printing the EOL *before* you print the text. It should be after because that is when the text is displayed. So "location1" is being printed at the line with "rightNextToLocation".
Nyx Erebos
Posts: 33
Joined: Fri Mar 01, 2013 1:26 am

Re: Bug with Irrlicht 1.8 shadows

Post by Nyx Erebos »

mongoose7 wrote:I think you are printing the EOL *before* you print the text. It should be after because that is when the text is displayed. So "location1" is being printed at the line with "rightNextToLocation".
Yes I used endl the wrong way :oops:

Now I'm pretty sure that it's the first smgr->drawAll() call which takes some time when I use shadows. Maybe it's normal ?

I've made a video to show some of my problems : http://www.youtube.com/watch?v=a9HflBYgjI4

First you see that the video is 1min42sec long and it takes 1 minute to start.
Then I use a spotlight and not a point light but you can see a round lit area on the ground and I don't understand why.
The quality is even worst than my other videos (I don't know why) so maybe you can't see it clearly but the right half of the stone is lit and not the left one, which means that the spotlight kind of works (so there's a mix of spotlight and point light).
Then you see the weird dog's shadow. I don't know if it's because of the mesh but I didn't have that bug with XEffects.
Finally when I cast a fireball next to the train you can see that the shadow appears on the top of the train. The mesh could be the reason here too because I didn't make it and I had to disable backface culling to see it right.

If someone could tell me how to properly use shadows/lights or give me a link to a tutorial that'd be great :mrgreen:
Nyx Erebos
Posts: 33
Joined: Fri Mar 01, 2013 1:26 am

Re: Bug with Irrlicht 1.8 shadows

Post by Nyx Erebos »

Basically I'm doing :

Code: Select all

ILightSceneNode* light = smgr->addLightSceneNode();
SLight lightData = light->getLightData();
lightData.OuterCone = 45;
lightData.InnerCone = 0;
lightData.Type = video::ELT_SPOT;
light->setLightData(lightData);
But as you can see in the video it still does that point light lighting. Am I forgetting something ?
Nyx Erebos
Posts: 33
Joined: Fri Mar 01, 2013 1:26 am

Re: Bug with Irrlicht 1.8 shadows

Post by Nyx Erebos »

Nobody uses spot lights with 1.8 ? A working example could save me a headache :wink:
Post Reply