Visual artifact with intersecting meshes.

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
RyanRay
Posts: 3
Joined: Wed Jun 28, 2006 2:52 pm

Visual artifact with intersecting meshes.

Post by RyanRay »

Apologies if this has been answered before, I've tried searching and the wiki seems to be down. Feel free to lock/nuke and PM me with the relevant info, if there is any.

I've been looking at switching to Irrlicht for various reasons, and in the process off assembling a toolset and running through a few tests I've come across a problem, specifically to do with intersecting meshes.

I've attached a picture of a simple scene with 2 intersecting meshes which when used in Irrlicht produces the jagged artifact.

Image

I've tried various scenes and various file formats, but they all produce the same result. I'm guessing it has something to do with the depth buffer, but all I really want to know is, can it be fixed or avoided?

Cheers very much.
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

mhh. maybe you scaled your mesh very small/big...
you can easily avoid it by don´t let tris intersect!
Amt0571
Posts: 128
Joined: Mon Mar 06, 2006 6:29 pm

Post by Amt0571 »

It happened to me with a nVidia Geforce 4 MX card on my university. At home, I tried with an MX 440 (but with newest drivers), a Radeon 8500 and a 6600GT (also with newest drivers) and the problem is not there, so I'll think it's a driver related problem.
mullencm
Posts: 3
Joined: Mon Jun 19, 2006 7:32 pm
Location: Boulder, CO

Post by mullencm »

I have seen this before in other sdks when I use 16bit window depth vs 32bit which in turn affected the z-buffer i think.
mullencm
Posts: 3
Joined: Mon Jun 19, 2006 7:32 pm
Location: Boulder, CO

Post by mullencm »

I have seen this before in other sdks when I use 16bit window depth vs 32bit which in turn affected the z-buffer i think.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, this seems like zbuffer fighting due to loss of precision in 16bit. 32bit is better anyway, but you can also change the view frustrum to reduce zbuffer depth.
RyanRay
Posts: 3
Joined: Wed Jun 28, 2006 2:52 pm

Post by RyanRay »

Thank you for all your help.

It's not a driver problem near as I can tell, as I'm up to date on all 4 computers that I tested on.

I'm also using 32bit, so I don't think the problem is there, though I won't discount this untill I know more about Irrlicht.

I think I'll just use .bsp maps for my levels, as the problem doesn't occur with them (obviously), and come back to the issue at a later date.

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

Post by hybrid »

There's also a pacth from IrrSpintz which is related to gfxcard FPU setting. It can happen that the FPU settings are left untouched, i.e. are using 16bit precision even for 32bit devices. Maybe it's something like that (I did not try the patch, yet, as I'm usually not using windows, and it's only happening with D3D).
mullencm
Posts: 3
Joined: Mon Jun 19, 2006 7:32 pm
Location: Boulder, CO

Post by mullencm »

I made the same just happen with dx9, then with opengl and the problem is gone.
RyanRay
Posts: 3
Joined: Wed Jun 28, 2006 2:52 pm

Post by RyanRay »

I'm quite happy as I've solved the problem. For those who care, it was a problem with the far clip plane. By default it's set to 2000. Bumping this up to about 15000 seems to get rid of the problem completely.

I solved this by accident, as I was messing around with clip planes in Light Map Maker and reproduced the similar artifact.

Thanks for your help anyway :D
Mutter
Posts: 11
Joined: Mon Jul 10, 2006 6:05 pm

another solve for this problem!!!

Post by Mutter »

I had exactly the same problem...

solved it:

i had to keep attention to the ORDER i create my objects!!!!

for example...these 2 walls with the ugly thing are created BEFORE the other walls and floors on the screen...

create the two top walls AFTER the floor and things...

this solved similar situation at my project
und wieder ein deutscher :)
Post Reply