Artifact appearing on large plane

I’ve run into a bizarre issue happening when playing with camera settings and a large plane (size 1000). At specific camera positions a line appears through the origin of the plane. I’ve screenshot an example below.

image

If I resize the browser window and change the canvas size it goes away. I’ve tried to recreate the issue as best I can in the playground (https://www.babylonjs-playground.com/#339A8H. I have manually set the camera position to the problem but it will likely only appear if the window is maximized.

I’m assuming this has to do with Z fighting in some way? But the plane has nothing really to clip with except itself.

Anyone have any ideas for how to solve this?

I do not repro here :frowning:

Can you test without the creating of the GridMaterial to try to isolate the issue?

Hi Tyzor,

I also do not repro. In addition to isolating by removing the GridMaterial, if you can reproduce the artifact while using Spector.js, you should be able to look through the draw calls and see exactly what part of the rendering is causing that artifact to appear.

1 Like

I can see the problem at home. I tried to remove the GridMaterial and the problem still exists.

This happens at a precise angle of the camera (when loading the current scene)

I’ve removed almost everything from the playground and the problem persists. (Kept the pointer move events so you can drag the camera around and see the line at certain angles).
https://www.babylonjs-playground.com/#339A8H#1

SpectreJS shows it’s in the draw call with just a basic plane.

It seems to be at the exact line where the two triangles of the plane form. Turning to wireframe rendering shows it. For now I’ve be able to get rid of the issue by adding more subdivisions to the ground plane.

Do you repro if you change the camera.minZ value?

Yes, I first thought it might be Z clipping or floating point issues with the near/far planes but no matter what I set the values to it would appear.

Only increasing the geometry on the plane seems to solve it. Or reducing the size of the plane will help as well. It seems to be appearing on the line where the two triangles of the plane join.

I’m using a maximized playground window on a 1920x1080 resolution desktop if that helps. It seems to also be affected by render size.

Which browser are you using?

Chrome but I just tested on Edge and it’s there as well. Maybe an issue specific to Nvidia drivers?

It seems a driver issue indeed…

Have you tried to lower the dimensions of the plane?

Yes lowering the dimensions of the plane or increasing the number of subdivisions makes the problem go away. I was trying to have the plane scale to put a grid on the whole scene so I guess having a few more vertices won’t hurt in the long run.

So it seems to be a precision problem in the rasterization performed by the GPU when rendering the triangles (or when doing clipping)…

What GPU are you running on?

GeForce GTX 1070, latest drivers

I just tried on a Surface Pro and the issue isn’t there so it must be how the card is handling it.

Yes most definitely