Z-Fight rendering issues that occur on Mobile, which do not occur on PC/Laptop

Description

Normal:

 

On Mobile, iOS:


 

I’ve created this test game to easily open up mobile and play the game. (Well, you have to copy the link somehow… on mobile… yep)

This issue has existed for long, but I don’t think there has been a focused Bug Report about it yet.

If you wonder, what is Z-Fighting? Here’s a very short video: https://www.youtube.com/watch?v=1PEzAE383_Y

 

THE ISSUE SUMMARIZED:

That what you SEE on your PC or Laptop, is not what you get on Mobile, when it comes to Z-Fighting.

Things that Z-Fight on Mobile don’t Z-Fight on PC.

The minimum offset from floor to part needed for this to not happen is about 0.1065 or less or maybe a bit more. But this causes there being a Gap, that shouldn’t be the case.

 

I took also an example from Alpha Strike Group’s Decal Placement strategy, where they apparently utilize the Mesh to place things on the floor in order to also adjust the offset. That one is actually also affected if you move the offset closer to the ground, but that’s an issue on all devices.

Different issue

This one is a different issue. From one side this plane is visible but if you look up it can disappear. Happens on both devices.

These here are SurfaceApperances on MeshParts

They Z-Fight more compared to Mobile.
image

 

Re-production Steps

  1. Create a thin part with lowest size possible
  2. Place it on a surface using the alignment tool on Studio, make sure it’s not on the same Z otherwise it would overlap and Z-fight intentionally.
  3. Observe

I’ve created a small little “sandbox” that focuses on Z-Fighting that is playable on all devices for quick testing.

 

 

Expected Result

That Z-Fighting is consistent across devices PC, Laptop to Mobile. The Z’s are not at the same location, it shouldn’t Z-Fight if the Z’s are not exactly overlapping.

 

Actual Result

WRONG Z-Fighting occurs on Face’s of Parts and things with SurfaceAppearance.

It doesn’t occur on Decals or Texture.

Here Z-Fighting is occuring at the thing that is accurately placed on the floor. (Not overlapping).

It is not occuring on the one where I put a gap of about 0.01065f

Notice how the Decal and Texture based yellow stripes don’t Z-Fight, but the Black Color Part does? The Decal and Texture is actually on that Black Colored Part. The only thing that is Z-Fighting is the Part however.

 


User Defined Terminology:

  • What is wrong Z-Fighting?
    • Wrong Z-Fighting is when two things are actually not even overlapping, but it Z-Fights somehow.

A private message is associated with this bug report

2 Likes

This is expected behaviour as the Near Plane Z varies across platforms. See this docs article:

That is something else.

What you have linked me is the occlusion of Z for the camera. Z Near and Z Far.

THIS has nothing to do with that.

 

Do not focus on this part of the video. This one is not directly Z-Fighting but something along the lines of strangeness it has nothing to do with how far the camera is, because there’s thing here that make absolute no sense. Not sure if you skipped the other two videos at the very very very beginning.

image

This is a different issue compared to things that hide when you’re too close with it on the camera.

I had to record it somehow so that it is under 10 MB to upload on the Forums.

Z Near is something else.

This is what a Z Near does

unrelated to this issue, as this is about Z-Fighting

the link you linked is actually a Property for the Camera just like the one on that video, does exact same thing

The Z Near influences how the clipping occurs; the farther the near plane the less clipping. You can test this in Blender by putting a plane against a cube at 0.1 and 0.001 Z Near: the 0.1 will clip at a lower distance than the 0.001.

https://dev.epicgames.com/community/learning/tutorials/199L/unreal-engine-fixing-common-issues-z-fighting
This covers how adjusting the near plane influences z clipping.

I noticed this a while back while testing my game on iPad. Weird stuff.

Which part in the video. He moved the shelf away from the wall so that they don’t overlap.

In this issue, all of the Z-Fighting things are NOT overlapping. It should only Z-Fight if it overlaps.

The only exception is the test cube with the red button. That one is intended that it Z-Fights because they’re overlapping. The funny thing is that they’re actually not Z-Fighting if they have the exact same location and size. I question what the Engine is doing here and how it figures that out.

You linked NearPlaneZ

Here is a Fast Flag FIntCameraFarZPlane, default it is set to 100000

I set it to 500 it changes how far the Camera can look.

I assume that NearPlaneZ is the opposite. I don’t know why I can’t set that value nor if it has any Fast Flags.

Have you tested this? I cannot give my own images rn but it demonstrates what I’m trying to say

You’re saying that if they’re overlapping in the “Z” , it will Z-Fight (depends, but the Z-Fight term always has the letter Z in it while it can occur from other sides as well).

Like so?

The issue on Roblox is that things that don’t overlap are Z-Fighting on Mobile compared to PC. I don’t know where the issue is, but it is definitely strange. Especially if things Z-Fight less that Z-Fight more on PC, that doesn’t make sense.

Offset the plane by a little bit to the point that it doesn’t z-fight on Near Plane 0.1, then change it to 0.001. It will z fight due to the changed frustum. I believe Roblox’s platform different near plane contributes to the weird behavior

This is just an acknowledgment announcement!

We’ve filed a ticket into our internal database for this issue, and we will update you when we have further information!

Thanks for the report!

But am I not just moving it back to where it overlaps?