• Advertisement
Sign in to follow this  

a problem of z-fight?

This topic is 4170 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Two boxes sticked together cause flimmering at their jiont? <br />

we export model from 3dsmax(as is showed in left pic).When the animation is over, the faces(perpendicular with z axis,ie. red or blue faces) of the models are aligned in the same plane. then the models are mapped with YUVA texture(use d3d), as shown in right pic. the problem is, split lines appear when the animation is over. is that a problem of filimmering? I have adjusted the nearZ and farZ, but cracks still exist; the difference is, cracks may appears at other positions. what's the point? please help me... BTW, if rotate the models a little( eg. 1/360 along Y axis ), the crack lines disappear.

Share this post


Link to post
Share on other sites
Advertisement
thx for reply!(my first post here)

to use z-bias, i have to divide all the polygons to different groups(maybe A face group, B face group and side face group), then add a bias to the A group and B group?

I donot know if this is a flimmering prolbem...
and even if it is, i don't want to re group the polygons, which lead to call drawPrimitive more times.

is there any other suggestions?

Share this post


Link to post
Share on other sites
Can't make out from the picture you have posted if what you say happens is due to Z-fighting.

In any case, if you are sure it is due to Z-fighting then you have a couple of alternatives.

1. If you are using DirectX, you can use Z-bias (D3DRS_ZBIAS or D3DRS_DEPTHBIAS). But Z-Bias is not properly implemented on all hardware.
2. If you are using OpenGL then glPolygonOffset() should do the trick.
3. Offset the viewport slightly.
4. Depth Bias.

All the methods are explained in detail here

I am using the glPolygonOffset() in OpenGL and the viewport method in DirectX for stencil shadows and it works.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement