XEffects Shadow Problem

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
Riktovitch
Posts: 15
Joined: Tue Mar 05, 2013 12:36 am

XEffects Shadow Problem

Post by Riktovitch »

I've been having a problem with XEffects, all of the shadows are off and it kind of ruins the look of everything. It's especially noticeable on the corners:

Image

It looks as though the block is floating, when it is on the same level as the ground.

Image

I noticed that this appears in the demos provided with XEffects as well so I don't think it's anything wrong on my end of the code. What I'd like to know is if there is a fix for, or an adjustment I can make to correct this. :(
Help is appreciated.
mikkis
Posts: 64
Joined: Mon Jan 28, 2013 2:38 pm
Location: Fi

Re: XEffects Shadow Problem

Post by mikkis »

Try to increase nearplane (ie if you use 0.1f, try 1.0f, or 2.0f), and if possible, lower farplane. Then there will be better perception in zbuffer so these errors should go away. (Im not 100% sure about this, because I have seen this many other engines too which I have used)

But then you cant go very near to object/very far from object, it clips it.

If one want good shadowing, use CSM, PSSM or so, but unfortunately there isnt working code for 1.8/svn version of irrlicht (at least I havent found).
Nadro's cg+pssm codes should be converted to newest irr? Anyone (but me:D)?

[edit] there is also beauty render which renders shadows using pssm,
http://irrlicht.sourceforge.net/forum/v ... =6&t=46113
but dont remember if that works with newest irr or not.
Last edited by mikkis on Sat May 18, 2013 11:25 am, edited 1 time in total.
Riktovitch
Posts: 15
Joined: Tue Mar 05, 2013 12:36 am

Re: XEffects Shadow Problem

Post by Riktovitch »

You seem to be correct. I originally had the shadow light ranging from 1 to 100, shining over the map. But, I changed the near and far values to 5 and 18 to offer more focus onto the current area and the shadows are much better.

So, I've been thinking about making the shadow light I am using as the Sun dynamic, in that it will automatically adjust it's near and far plane, and field of view, in order to focus more on the players relative area rather than attempting to shadow everything. Shadow lights that I put in doors will just have to be adjusted for that specific space instead of using the same generic range values for each one, which isn't that much of a problem.

Image
Post Reply