Shape transformation precision


I am wondering as to the correct way to solve this particular issue:

Two shapes which should be intersecting appear to have a gap between them when zoomed in closely, however when zoomed out, one shape can be seen protruding through the other. The amount of protrusion varies with the relative camera angle also.

One shape is the result of revolving a wire through 360deg and the other (grey) shape is a shell of fused faces.

I've included some screenshots demonstrating this.

Any help on this matter would be greatly appreciated :)

Kirill Gavrilov's picture

Z-buffer rendering involves calculation of a depth value along the ray from eye to each pixel, and implies some additional precision losses. When objects are very close to each other or even match geometrically but not topologically (for instance, two equal planes split into different triangles) the issue known as Z-fighting occurs. This problem has no trivial solution - in each case different approaches could be considered to reduce visual artifacts.