Line between faces becomes invisible or sometimes dashed-line

Hi guys, I’ve come up with a question maybe related to z-fighting or something.
When I draw a line at the exact location where the connection edge of any two faces should be, the line just becomes invisible or very hard to see(becomes dashed line sometime). See the picture below:


As you can see, the black line locates at the connection edge between these two boxes. In zone1, you could notice that the line becomes thinner and lighter strongly. In zone2, the line just vanished.

While sometimes this line could be dashed line between two faces(as you could see in zone1 below):


I assume that the problem is caused by z-fighting or something, as the line shares the exact same depth as the connection edges of two faces of those boxes.

How can I make such line become extirely visible without changing the vertex coordinates of the line or boxes, and without changing the renderingGroupId(I need them to share the same renderingGroupId)? One of my friend advised me to use methods like glPolygonOffset, but that is the solution for OpenGL, not us.

Hope to hear from you guys soon! Thanks!

Oh here is the PG example I forgot to push forward! You can try to open it here!

You can draw the line without taking into account the depth buffer by setting the material.depthFunction to ALWAYS:

thanks for your advice! My bad I did not make myself clear! I still need the depth buffer count, which means that when the line is behind the box I really need the hidden part to be invisible!

In that case, material.zOffset would be the way to go, but it does not work for lines…

So, you would have to replace the line by a thin tube or a thin cylinder, to be able to set something like material.zOffset = -2 for eg.

2 Likes

Thanks! Though your method is not available for me (can’t alter the line), but it inspired me that I could set all the material of the boxes and set their zOffset = 1, then the depth of all faces just went behind the line.