Advertisement

Fix z-figthing when rendering edges over a mesh

Started by March 21, 2023 04:05 PM
1 comment, last by Aressera 1 year, 7 months ago

Hi

I'm currently trying to find an optimal solution to display a wireframe over an object using a geometric shader, but all I could find is “Single-Pass Wireframe Rendering” method. Is there any other rendering method that can achieve this? Or is there any literature? I need to know the other methods so I can compare them with each other.

Please point me in the right direction.

To fix z fighting when rendering a wireframe on top of another mesh, you want to change your depth test to something similar to GL_LEQUAL (less than or equal to comparison), instead of the usual GL_LESS. This will make your depth test succeed if the depth is equal (which is the case if you render the same mesh twice, once solid and once wireframe). You need to make sure to render the wireframe after.

This topic is closed to new replies.

Advertisement