missing pixels

Started by
6 comments, last by Desa 14 years, 7 months ago
Sometimes when drawing a mesh I get a few empty pixels in certain rotations. Here is a screenshot. I'm drawing this example using glDrawElements and GL_TRIANGLES. Thanks for any advice you can offer.
Advertisement
Usually this is due to a hole in the mesh, usually caused by T junctions

Or you might be drawing a depth prepass that doesn't perfectly match the main pass
What are T-junctions?
T vertices:
http://www.cs.princeton.edu/courses/archive/spr98/cs598d/lectures/alejo/sld002.htm

See that the edge of one triangle goes right across the vertex in the center. It should instead stop there and form another triangle.

As for your original problem not quite sure. Can you do an image in wire frame?

glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
// render mesh

Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.

hmm don't think your problem is t vertices then. Are those vertices shared between triangles or are they unique?

Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.

I had / have a very similar problem:

You can see it here:
http://www.iced-liquid.com/media/glow_cubes/screenshots/GlowCubes-ScreenShot4.jpg

On the trailing edges you have white pixels. (Ok the are hard to spot in the screen shot, but you see them like hell when they move and flicker.)

Same here you have the "broken pixels" on the trailing edges.

In my case I used a early Z-rejection pass; i.e. I filled the z-buffer with a quick depth only pass. The subsequent color passes made depth test misses in those places. Not filling the z-buffer "fixed" the problem, only now I have a 20% speed decrees.

I don't know if you are using multi-pass rendering algorithm, so my guess is check your depth test function. Is is properly GL_LEQUAL and cleared every frame. Does the problem change when you rotate the mesh?

Edit:

Look at your line rendering, at the intersections you have white pixels. Check your depth function.
Rioki - http://www.rioki.org
Nanoha: Yes, they are shared. That above example is using GL_TRIANGLES but I've also tried rendering strips of GL_TRIANGLE_STRIPS to create the surface but I still get the missing pixels.

rioki: Thanks for replying! Yes, the pixels will go away and come back as I rotate the mesh. I am using GL_LEQUAL and clearing the depth buffer with every frame.

I also just tried disabling the depth buffer completely and the problem is still there. Could you describe more what you did to fix the problem?

This topic is closed to new replies.

Advertisement