The line rendering overlay displays differently under different graphics cards

I created two sets of wireframe models on one model. one set is used to display the mesh edge which is white, and the other is used to display edge highlight effects which is red.

Using my AMD integrated graphics card, the red wireframe can completely cover the white wireframe display, and rotating the camera will not go wrong.

But using my NVIDIA standalone graphics card, when rendering the camera, the wireframes will turn white in some places.

If I want to keep the red wireframe covering the white wireframe, how should I do? Or, can I set the width of wireframe?

AMD integrated graphics card
highlight-normal

NVIDIA standalone graphics card (RTX 2050 & RTX 3060)
highlight-bug

if I comment line 66, I get the white wireframe on top of the green mesh.So, looks line the red linemesh is rendered over the white line.
To me, it looks like z fighting.
This is quite confirmed if I comment the code to create cylinderWireWhite and enable the line mesh.
Check Material | Babylon.js Documentation to see if this can be fixed.

2 Likes

Thank you for your reply, @Cedric . But point rendering and line rendering mode are not affected by the zOffset property. So how to deal with line mesh z-fighting ?

why do you need red line rendering over white line rendering?

Firstly, I want to display the mesh wireframe. And then users can choose edges they want, which will be highlighted. And users can also mark the edge as seam edge which has been choosed to a third color. Then I will unwrap the mesh through the seams.

You can have vertex color with the line mesh. So, with just one pass, you should be able to tag face/edges.

1 Like