Strange visual bug

Hello,

We are the developers of Steel Wars Royale and we are having a very strange issue. We are using Unity 2019.4.16f1.

In some low-end devices, we are having the issue you can see in the picture below:

This is how the map should look:

For some reason, the plane of the floor seems to be rotated covering part of the map.

Could this be related to Zbuffer not having enough precission or with related to old openGL versions? This only happens in some low-end Android devices.

We don’t even know were to start looking to track the bug. If anyone has any idea, it would be very much appreciated.

How is the ground being rendered? Is it just a quad mesh placed on the ground or is there something fancier happening? And is it using some special shader? Is it using a custom mesh?

It doesn’t really look like z depth precision to mean, it looks like the top right vertex of the ground is pulled towards the camera for some reason.

It’s a simple quad mesh imported from 3d studio max.

There’s no script or anything fancy going on, just a mesh.

(ignore the baked lights artifacts on the rocks)
6915716--811100--upload_2021-3-9_9-0-20.jpg

The material is just a Mobile/Diffuse
6915716--811103--upload_2021-3-9_9-1-13.png

So, just a normal mesh with a normal material… very strange. It happens in more maps, not only this one.

Again, I don’t have a clue of what could be the cause of this. As you say, it’s like if the top left vertex was pulled up or something.

The only hint I have is; It only happens in some low-end devices like “Android v9 LG device, model LM-X410TK

I have double checked and the Znear and Zfar planes are correctly set, so it should not be a problem of Z precission.
6915716--811106--upload_2021-3-9_9-5-28.png

Seems that the ground is just a quad with 2 triangles. May be subdividing the terrain mesh magically solves the problem, or the problem is still there but since there are more vertex, it’s barely noticeable?

I’m still trying to figure how to track this rare issue.

I think I’ve seen similar issue long time ago when rendering skybox on a specific device. This is potentially caused by gpu driver, if triangle is outside the clipping volume OpenGL will reconstruct the triangle as one or more triangles to fit inside the clipping range. So in your case you have two huge triangles, whose all vertices are being clipped, that has possibility that the reconstructed triangles don’t exactly match the original ( due to lack of precission, or some faulty optimizations). In my mentioned case, the only workaround was to subdivide the large triangles, so that most of the screen would be rendered correctly with the original smaller triangles, and the distortions would only happen at the edges of the screen, where triangles were being clipped (also clipping of smaller triangles did produce less distortion so it became barely visible).

2 Likes