20
$\begingroup$

For instance, here I have two cubes that are offset only on the x-axis. When I render them (using Blender's internal renderer), the overlapping faces interfere with each other and the result looks awful. A quick and easy solution would be to offset them by just a smidget, but is there another solution that allows faces to overlap and not exhibit this graphical glitch?

ew overlapping faces

$\endgroup$
  • $\begingroup$ Renderers really hate overlapping faces; they don't do well with figuring out what materials/textures to give precedence to. As such, overlapping faces are a major concern. $\endgroup$ – Kyle Willey May 22 '13 at 22:10
  • $\begingroup$ @GiantCowFilms: What? This question was asked in May and that question was asked in December. $\endgroup$ – El'endia Starman Apr 11 '16 at 19:54
  • $\begingroup$ @El'endiaStarman Policy states that we should prioritize best content. The answers on the other post are better and it has more votes. I know it might seem a little unfair, but stack exchange is about building up a knowledge base, sometimes at the cost of giving someone the shorter end of the stick (quite frankly though, I sort of agree with you personally) $\endgroup$ – GiantCowFilms Apr 11 '16 at 20:23
  • $\begingroup$ @GiantCowFilms: That's quite understandable, and there's a similar policy on at least one other site that I frequent. Was just weird to get that notification almost three years after I asked the question. :P $\endgroup$ – El'endia Starman Apr 11 '16 at 20:38
  • 1
    $\begingroup$ @GiantCowFilms: Ahh, I see. Well, I went ahead and finished the closure since the other question and its answers are definitely much better. :) $\endgroup$ – El'endia Starman Apr 11 '16 at 21:37
13
$\begingroup$

As a general rule of thumb you should never have overlapping faces as you'll almost always get the artifacts you're seeing.. You're better off removing the overlap.

$\endgroup$
6
$\begingroup$

Well, the short answer to your question...

"is there another solution that allows faces to overlap and not exhibit this graphical glitch?"

...is no.


The glitch you are seeing is called z-fighting, and it is essentially impossible to avoid where you have overlapping, coplanar faces.

From Wikipedia:

Z-fighting is a phenomenon in 3D rendering that occurs when two or more primitives have similar values in the z-buffer. It is particularly prevalent with coplanar polygons, where two faces occupy essentially the same space, with neither in front. Affected pixels are rendered with fragments from one polygon or the other arbitrarily, in a manner determined by the precision of the z-buffer.

Basically what is happening is when two coplanar faces occupy the exact same space Blender doesn't know which of the two faces to render. The faces are "fighting" which one is closer to the camera. So due to floating-point calculations in the distance to the camera (z-buffer), various points of the shared surface are rendered as one of the faces, and other parts are rendered as the other face. This results in the strange, undesirable glitch you are witnessing.

So without actually moving one of the fighting faces (which you have excluded) there is no way to eliminate z-fighting.

$\endgroup$
  • $\begingroup$ I wouldn't mind as much hitting one face or the other randomly if they weren't shadowing each other. It hasn't happened to me yet, but it did occur in the asker's case. Was this fixed in a later version of Blender? Clipping the bouncing rays at some minuscule distance should do the trick. $\endgroup$ – John Dvorak Mar 5 '17 at 12:52
  • $\begingroup$ @JanDvorak No it wasn't fixed. It probably never will be fixed either, it's probably the most famous glitch in 3D graphics and any software/renderer will experience it. The only way to fix it is to not have overlapping faces. $\endgroup$ – PGmath Mar 5 '17 at 15:54
  • $\begingroup$ Having near clip on bouncing rays should cut it, shouldn't it? Solid materials can also be fixed manually by culling backfaces (and intersecting transparent materials are nonphysical in any case. $\endgroup$ – John Dvorak Mar 5 '17 at 16:14
5
$\begingroup$

In blender-internal renderer there is a material option 'Z Offset' you can use to force one material to render on-top of another even if the faces overlap. This works in the game engine too and is quite handy at times.

$\endgroup$
  • 1
    $\begingroup$ Is Z Offset only for Z-Transp materials? That's what the tooltip suggests. It's otherwise grayed-out. $\endgroup$ – Mike Pan May 23 '13 at 4:58
2
$\begingroup$

One way to avoid this kind of overlap is to use the Boolean modifier. If you have two shapes that are overlapping, you can join them together into a single shape by selecting the Boolean modifier and selecting 'Operation: Union.' In the example you provided in the question, this will give you a single rectangular prism you can manipulate that will render as one smooth shape.

Screenshot of Boolean modifier

$\endgroup$
  • 1
    $\begingroup$ I don't think this works as you'd expect. Actually, the resulting render will be even worse, due to how the resulting mesh is constructed. $\endgroup$ – jesterKing May 23 '13 at 10:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.