Jump to content
  • Advertisement
Sign in to follow this  
Desa

missing pixels

This topic is 3203 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
hmm don't think your problem is t vertices then. Are those vertices shared between triangles or are they unique?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!