Render glitches nearly coplanar faces

Hi there!

I’m working with a triangulation geometry and I’m getting some glitches where:

  • several primitives share one edge: sort primitives in depth camera axis ? and _.depthCompareFunction = .lessEqual

  • two primitives or are nearly to coplanar: improve rasterizer depth order test. How?

I need all the faces, inner too, because I’m working in a crystal shader with transparency

Any hint?

I haven’t had this problem. But I did find several things to research:

I believe this is the same as OpenGL’s glPolygonOffset:

With glPolygonOffset, this is really old so I don’t know how valid it is, but maybe worth following up:

Same old source - this looks interesting using Stencils:

Discussion of various methods:

1 Like

Thanks @caroline for all this stuff!!
Has led me to the solution