1
votes

I have this polygon with a hole when rendered in translucent color in openGL, it shows some sort of artifacts along seams of tessellated triangles (by GLUtesselator). This is a bit of strange because the same polygon would not have such artifacts if it's drawn in opaque color.

Artifacts seen as doted line extended from inner circle to outer boundary of polygon:

img

More artifacts seen in interior of the polygon:

img

It appears like bleeding from alpha blending of color between two adjacent triangles' edges. But I have no idea of how to mitigate the problem.

Has anyone seen this problem before? or can someone point out what the problem might be and a possible solution for me?

1
Do I see it right that you used 10-20 polygons to compose this? Do you use textures or it's just plain color? Why does the rectangle have a border?Crouching Kitten
Please show the relevant code parts.BDL
what depth test you use?Spektre

1 Answers

3
votes

OpenGL guarantees that drawing two triangle sharing an edge will produce each covered fragment exactly once, thus you could render artifact-free translucent polygons.

However, this guarantee holds only if both vertices of that edge are identical between the two triangles. Also it won't hold if you anti-alias your polygons with GL_SMOOTH_POLYGON.

It's hard to tell what's the case here without seeing the relevant code, but I would definitely check the coordinates of the vertices of the shared edges to see if they are the same.