Search code examples
3drenderingpolygonpapervision3d

3D rendering - What is this problem called?


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!


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.