a problem of z-fight?

Started by
2 comments, last by _neutrin0_ 17 years, 6 months ago
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.
Advertisement
Have you tried to fix it with z-bias?
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?
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.
++ My::Game ++

This topic is closed to new replies.

Advertisement