Display FPS - Problem with transparency


Now, I can display the FPS on the screen but here’s my problem :

When I display the FPS, I must activate the transparency with “glEnable(GL_BLEND)”. It works but when 2 polygons are in front, the first polygon is transparent.

Example :

you have a house. you’re in front of the house. The wall in front of you is transprent, we can see the next wall.

It’s a problem of parameters, I know that it exists GL_SRC_ALPHA, GL_DST_ALPHA, … but wich of them I must use ?

If you can help me, I can give you the source code of my program …

If you don’t understand what I mean, I can send you my program and you’ll be able to see my problem.

Thanks a lot.

i’m not sure what you mean… you have two transparent polygons? and one doesn’t appear? or a solid polygon is unintentionally transparent?

please elaborate here on the board, or email me with elaboration.

For transparent/semi-transparent polys you have to do a couple of things:

  • Turn on blending (which you have done)
  • Draw them after opaque polys
  • disable the write to depth buffer (keep the depth test)

What can happen is you draw them before opaque polys with depth writing on, is that the part of the opaque poly behind the transparent one will not be drawn at all.