I have some textures and I want them to be completely transparent at some positions (i.e. for sprites). Now transparency works but I have a little problem. I don´t sort the polys up to now and when I draw a partly transparent polygon and after this I draw a second one, which lies behind the first one it doesn´t shine through. I think this happens because when I draw the first one it updates the z-buffer even at positions, where nothing is drawn.
Now: Is there any way to prevent OpenGL from updating the z-buffer where a pixel is completely transparent? Or do I have to sort the polygons from back to front?
you have to sort them to achieve the effect you want.
however, there is a workaround that works for some types of problem:
if your semitransparent objects are bitmap objects (billboarding) like trees or explosions etc. make sure they are drawn towards the end of your gfx pipeline and place the following:
glDepthMask(GL_FALSE);
// draw your transparent objx here!!
glDepthMask(GL_TRUE);
basically, this switches the z-buffer to READ-only. it works for me, but it depends on your type of problem if this suits you