Edge Conditions Between Meshes

Started by
3 comments, last by BLG 18 years, 6 months ago
I'm having a weird issue with different meshes being rendered where it two meshes sit side by side. With identical meshes, this artifact does not appear. Different meshes with similar textures/architecture, however, throw out this artifact: Edge Condition Problem? If I move the camera JUST SLIGHTLY in any direction/orientation, the artifact disappears and reappears. It really seems to me like an edge condition issue, where DX is choosing to display one mesh's edge over the others depending on the angle from the camera. Is there something I can do to fix this so that one mesh always shows up on top, for example? -dbh
------------------------------------------------------------GDC/IGF 2006 Student Showcase Submission: Curator Defense
Advertisement
I had this same problem when creating a tile engine, using basically cube meshes at the time. When setting them side by side in a line formation and rendering, artifacts like yours would appear. This is caused from Z-fighting between the up facing surface and the polys on the same edge facing the camera. You can try enabling W-buffering and/or toy around with the near and far view planes to get more accuracy in the buffer or you can resort to the ZBIAS or other more reliable forms of matrix biasing tricks.

If this doesnt work there are some complicated workarounds like combining the meshes in order to only use one translate which produces less inaccuracies. You can also make specialized peices that fit together better without the overlapping poly problem (cube missing a side for example).

Also realize that the biasing techniques are very resolution size dependent. When fixing this problem I recommend that you set you app to your highest resolution possible. This will most likely make the problem more apparent and in the end easier to track and fix.
Boo ya grandma.. boo ya!
I do have the Z-Buffer enabled, and my far/near clip-planes are set to the only real balance I can live with... so I'm going to do some research into the ZBIAS you were talking about to see if I can figure something out.

Thanks for the tips; that was what I was afraid of ;)

-dbh
------------------------------------------------------------GDC/IGF 2006 Student Showcase Submission: Curator Defense
Just an update for anyone who has similar issues...

I changed the D3DRS_ZFUNC setting to LESS instead of the default LESSEQUAL for rendering my game objects. Then I set it back to the default for rendering any 2D Sprites that appear on the same plane as the camera.

This fixes all of my vertical issues... the sidewalk shown in the above screen still has the problem, but I am going to fix that by combining the two vertical tiles into one.

-dbh
------------------------------------------------------------GDC/IGF 2006 Student Showcase Submission: Curator Defense
Glad to hear you found some work arounds.
Boo ya grandma.. boo ya!

This topic is closed to new replies.

Advertisement