shadow speckles

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.
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

shadow speckles

Post by xDan »

Hi :D
My shadows have speckles in them :-( Almost like the model has lots of small holes in it which keep dissapearing and appearing.

How can I fix this?

Here's a screenshot:
http://www.freepgs.com/defilter/images/ ... eckles.png
the speckles change every frame. you'll have to copy the link to get it work

Thanks
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I guess it's zbuffer fighting. The terrain sometimes wins and is thus rendered in front of the shadow.
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

Is there anything I can do? I tried making the zfar close (like 300).

The reason I moved to irrlicht was because I wanted easy shadows. Oh and particle effects. And normal mapping. And water. 8)
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

Let me try a different tack. Has anyone managed to get shadows working without these problems? Just, like, out of interest.

If not I guess shadows should be removed from irrlicht's feature list. :D
gfxstyler
Posts: 222
Joined: Tue Apr 18, 2006 11:47 pm

Post by gfxstyler »

yeah, i can enable them and they look just normal.

does your mesh have holes?
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

no
I've googled z fighting and tried suggestions - larger znear, closer zfar but to no avail :-(
is there a way in irrlicht to increase the zbuffer accuracy? and what is it by default?

a quote from a website: "glDepthFunc(GL_LEQUAL); // we put it again to LESS or EQUAL (or else you will get some z-fighting)"
*wonders if GL_LEQUAL is set*

although I suppose it must be all correct or other people would have problems.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Code: Select all

$ grep -r GL_LEQUAL .
./COpenGLDriver.cpp:    glDepthFunc(GL_LEQUAL);
./COpenGLDriver.cpp:    glDepthFunc(GL_LEQUAL);
./COpenGLDriver.cpp:    glDepthFunc( GL_LEQUAL );
And no hits with GL_LESS. So at least not the wrong value is set :lol:
Did you try the same with DirectX? Spintz produced a fix for it to keep the FPU precision high if set to high in your settings. IIRC there is the possibility to have 16bit and 32bit zbuffer and Irrlicht usually reset it to 16bit without this fix. Maybe the same holds still for OpenGL in some occasions?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Another short update n this topic. The problem is easily reproducable: Start the SpecialFX example and turn on real-time shadows. You'll the the errors right behind the dwarf on the topmost step. At least for the unpatched irrlicht-1.0. I could not see this problem in irrlicht-0.14.
xDan, could you please try your app with 0.14? I'll check the source diff where the probably causes could lie.
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

I'm using 0.14 :)
I don't think I have it compiled for directx but I will find the libraries and try it...
maybe I will try out 1.0 as well.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Darn, so it's not due to engine changes, but a longer term problem. The SpecialFX example changed textures and probably other things, so this might be the reason for appearance in the latest version.
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

Looks the same with directx 8 or 9.
I will go have a look at irrlicht 1.0...
funcdoobiest
Posts: 48
Joined: Thu Jun 15, 2006 6:35 pm

Post by funcdoobiest »

Any news on this, having the same problem with the character model: animated .X mesh, made in 3ds max, not sure which exporter the artist used, resaved in the DX model viewer.
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

Hybrid:


It may not be a problem with Irrlicht at all, the dwarf mesh has a gap under its head to save on polygons, its not visible unless you take the body away. Maybe someone skilled in modelling can fill it in and hopefully it will fix this.


Off topic:

Irrlicht’s shadow system is very limited (eg options in turn self shadowing off, what meshes receive shadows, etc) are there any future plans to improve this?
funcdoobiest
Posts: 48
Joined: Thu Jun 15, 2006 6:35 pm

Post by funcdoobiest »

^ I very much doubt it, if xDans problem is anything like mine, it appears that there are loads of TINY holes (like the size of a pixel) but I am certain it is not a problem with holes in the mesh, that is simply the easiest way to describe how it looks... and also the models I am using are all closed volumes.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

can you provide a screenshot? what's your graphics card? does it happen in OGL? can you provide a model file? is the recieving surface flat, or bumpy? does it only happen when the shadow is over certain type of material? have you tried the latest svn version of irrlicht?
if we can get enough info and a repeatable test case together this thread can be moved to bug reports.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply