No transparenzy with GL_DEPTH_TEST

Hello,
I have a problem by non-displaying transparent regions of my textures.
After i used GL_DEPTH_TEST my transparent regions became black or the background color.
I read something about double rendering but i dont get it how it works corectly.
I tryed:


glDephtFunc(GL_GREATER)
glDephtMask(false);

FIRST RENDERING

glDepthFunc(GL_LEQUAL);
glDepthMask(true);

SECOUND RENDERING

The result of that was that they are still overlapping each other.
Heres my actual result of my system:
(rendered 1 time with GL_LEQUAL and DepthMask true)

http://imagesload.net/img/dasdasdwerdfwe2333344343fsdf.png

(the number shows u the order in that i rendered the objects)
My blending:
gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE_MINUS_SRC_ALPHA);

It would be very welcomed if this method is the badder 1 of some easy methods.
I dont think that im able to split my polygons in smaller 1 so they dont overlap each other.

If you’d have a less offensive nickname, I’d have said you’d need glAlphaFunc(), but now I don’t really feel like it.

Thx i will try around with it.
(my nickname does not mean that i wanna kill u :persecutioncomplex:)
i didnt modify the AlphaFunc so it should be GL_ALWAYS.
The textures have an alpha channel and they are transparent, but they delete some party of the other textures.
What i dont understand is why they always delete 1 texture and leave the rest in peace?

http://imagesload.net/img/dasdasdae3323rfgrtbvgrt.png

This picture shows the first rendered battler behind the secounds rendered, they dont erase some regions of each other, only if i put the first rendered in front of the secound rendered some parts of the secound rendered will be delete

If you do not use glAlphaFunc, the depth value of transparent fragments (pixels) will be written to the depthbuffer.

Therefore you must depth-sort your triangles, when using transparency. Intersecting triangles can never be correctly depth-sorted.

If you use glAlphaFunc, fragments with a transparency below/above X will not be rendered, and not written to the depthbuffer, resulting in the ‘transparent’ parts to be cut off the sprite, which allows intersecting geometry.

I dont realy get it :confused:
i used: glAlphaFunc(GL_EQUAL,1f);
but it didnt changed anything.

Edit: nvm, it was a result of my stupidity…
forgot to enable ALPHA_TEST.
Thx for ur help ^^
(Can i change my name or do i have to wait until i can change it?)

Just say the name you wish to have, I can change it for you.

Bananni
that would be a nice name :3
thx :slight_smile:

what was his name before?

glAlphaFunc(GL_EQUAL,1f);
can sometimes be in accurate.
I find that using
glAlphaFunc(GL_GREATER, 0.99f);
more effective

What’s hilarious is that I can’t do this.

No joke.

The permissions on this forum are very messed up.