How to fix z fighting of lines

Unfortunatelly, I do not get z-fighting between lines on my computer. Maybe it depends on the graphical card? In any case, try the following ideas:

  • polygonOffset has no effect on lines, use if only for polygons
  • turn off depthTest-ing in the material, so that drawing lines ignores depth data
  • set renderOrder of the Axes instance, to insure it is drawn after the grid

Does the following demo work fine on your computer?

https://codepen.io/boytchev/full/xxQLOmy

image

4 Likes