Question

hopefully a sensible question this time...

See in the picture how the top half has the textures looking ok, but then the bottom half (after it rotated a little more)the texture is breaking up, and you can see the inside of the shape? the polygons have dissappaered?

What is this problem called? I need to know so I know what to look for when fixing it!

Incidentally, I'm doing this in Papervision. If you per chance know the fix (or if it is possible), I will give you permission to feel extra good about yourself if you can point me in the right direction.

What is this called?

Thanks heaps!

Was it helpful?

Solution

We called it "z-fighting" - but a more common term is z-ordering or z-buffer problems.

I'll try and explain the problem without diagrams 1st.

3D renderers work by drawing the polygons from back to front. It does this by assigning each polygon to one of a discrete number of positions. This works for most scenes.

You get a problem when there aren't enough slots to be able to decide which polygon is in front of another.

To solve it - it will depend on your application, but there are a number of things which should be common to all:

  1. Make sure the bounding box of the world is as small as possible.
  2. Increase the colour depth of your display. Both OpenGL and Direct3D can tie the number of z slots to the resolution of the display.
  3. Increase the number/decrease the size of your triangles. Smaller triangles are going to be less affected by this - but will decrease the performance as there are more to draw.

If you are running on Windows you should set the desktop to the highest colour resolution. You application might pick that up as the default to use.

Can you switch between OpenGL and Direct3D rendering? If so then try both, one might give better results than the other.

OTHER TIPS

Seems to be a Z buffer problem, somehow. I'm not familiar with what you're using there, though, so I probably can't really help.

Looks to me more like a decal that went wrong rather than z-fighting. Z-fighting usually has some jagged edges. The projection matrix for that particular triangle might be wrong (considering that the extent of the problem depend on the camera position).

It's called linear mapping, it's a way to map the textures on the polygon. But this method is not perspective corrected, which leads to broken textures at extreme angles.

Linear Mapping Perspective Corrected texture mapping

Linear texture mapping (up) and perspective corrected texture mapping (down).

The only workaround is to add more polygons, which will hit performance (See this demo).

Do you have multiple overlayed textures and/or polygons?

From here it looks like the problem you get when you have exactly coincident surfaces, but floating point errors mean that you don't consistently see the right one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top