0
$\begingroup$

I have a group of legionary puppets fighting busily in Game Engine. They are mesh animated by armatures, and have equipment parented to empties parented to the armatures:enter image description here

So they look like inthe orthographic embedded player.

However when they are looked at through the perspectivic camera (parented to another puppet's head), both in embedded and standalone player, they show a curious graphic issue: enter image description here

The bodies of some of them is seen (or maybe actually is) in the front of their shields. What is the cause of this, and how I might try to resolve it?

EDIT: Further testing showed that when they are not moving and displaying the animations the issue nevertheless occurs, and that ortographic cameras avoid it.

EDIT2: The issue was finally found to be related to the absurdly small (0.00000001) 'camera near clipping distance', which I have set to see my own cheek-plate. It has nothing to do with offsets, levels of detail or parenting. But I still can not infer why this should cause such a problem.

$\endgroup$
  • $\begingroup$ Could it be you enabled "Alpha blend" on the materials? $\endgroup$ – Monster Nov 27 '17 at 8:50
  • $\begingroup$ @Monster I only see a changeable property named 'alpha blend', no checkbox. It is set to opaque, but changing it does not seem to help. $\endgroup$ – b.Lorenz Nov 27 '17 at 18:05
  • $\begingroup$ I asked because this can cause sorting issues when used extensively. $\endgroup$ – Monster Nov 28 '17 at 5:51
  • $\begingroup$ You above image looks like the shields got an offset (I can't tell where this could come from). Can you have a camera that orbits around your scene? It might show more details on the topic ( a demo blend would help too). $\endgroup$ – Monster Nov 28 '17 at 5:52
  • $\begingroup$ @Monster Thanks, really. But how can I attach a (blend) file? There does not seem to be an icon for this, only for images. $\endgroup$ – b.Lorenz Nov 28 '17 at 13:51
1
$\begingroup$

EDIT2: The issue was finally found to be related to the absurdly small (0.00000001) 'camera near clipping distance', which I have set to see my own cheek-plate. It has nothing to do with offsets, levels of detail or parenting.

You found the issue by yourself. I just want to answer the followup question:

why this should cause such a problem.

The 3D engine of the BGE uses Z-Buffer processing to "sort" the rendered pixels. This means your scene will be "sliced" between the near and far clipping distance of the camera.

Within one slice the render can't decide which face is in front of the other. So it will pick more or less a random one. That is the reason why you should avoid planes covering each other with a very small distance (e.g. a painting at a wall). This can cause Z-Fighting at pixel level.

In orthogonal mode you see the same detail level at all distances. Therefore the z-Buffer is equally distributed (all slices have the same thickness).

enter image description here

In perspective mode the object near to the camera are rendered with more visible details than objects more far away from the camera. The sliced near the near clipping plane are thinner while the slices near the far clipping plane are thicker.

As you setup a really close near clipping plane you get a really detailed helmet with the costs of the other characters end in very thick slices.

I assume the result was that the complete shield and the legs are within the same slice sometimes rendered in the wrong order. The slices are so wide that you can't see pixel-wide Z-Fighting (or it is not obvious in your sample images).

Solution

Obviously the near clipping plane should not be that close. When you set up a more practical value (e.g. the default value) you should avoid the z-fighting effect.

There are several different options to show the helmet.

  • use an overlay scene to render the helmet (best option)
  • move the faces of the helmet more far away that it is still in the camera frustum
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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