[Lwjgl] Partial transparent texture on Voxel don't render correctly (SOLVED)

Hello everyone,it’s me again for a small but annoying problem. I currently try do make a voxel engine, everything is going one more or less well but globally it’s fine.

One of my problem is that i have a leaf texture which is of course transparent in some point but when i render it the transparency only apply for the current chunk (161616 group of blocks) which the leaf block is. And for the rest its the absolute nothingness.

A picture will explain this more :

http://image.noelshack.com/fichiers/2014/34/1408828374-leaf-prob.png

In render each chunk in an interleaved VBO and i have enable BLEND etc…

If anyone have an idea of what’s going wrong so i can try to fix it, i’ll be glade. My opinion its that i draw the leaf before the other blocks so when the transparency is enabled there is nothing behind it, but i really wishing i’m wrong.

P.S: sorry for my bad english, it’s not my native language.

You can fix the fully transparent pixels by enabling alpha test.

As for the translucent pixels, it’s a really annoying problem with OpenGL. What most people do is separate the semi-transparent blocks from the opaque blocks, and render them separately.

In addition to separating transparent blocks from opaque blocks, you will also have to sort from back-to-front, so that the blocks farther away get rendered first.

Hi ! So i create a separate list for all my transparent voxel and then render it after all the other chunks and its working. Thanks to you two for your help and quick response.

I’ll mark this problem as solved.

;D

maybe disable backface culling (also check shader for not using gl_FrontFacing) and depth-write.

GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDepthMask(false);

// render transparent things

GL11.glEnable(GL11.GL_CULL_FACE)
GL11.glDepthMask(true);

probably not working tho :wink: … you would probably get z-fighting next.