Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (777)
Games in Android Showcase (231)
games submitted by our members
Games in WIP (856)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Lwjgl] Partial transparent texture on Voxel don't render correctly (SOLVED)  (Read 3057 times)
0 Members and 1 Guest are viewing this topic.
Offline Akinesis

Senior Newbie

Exp: 3 years

« Posted 2014-08-23 21:16:59 »

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 (16*16*16 group of blocks) which the leaf block is. And for the rest its the absolute nothingness.

A picture will explain this more :

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.

What doesn't kill you, give you XP.
Offline HeroesGraveDev

JGO Kernel

Medals: 382
Projects: 11
Exp: 4 years

┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻

« Reply #1 - Posted 2014-08-23 21:44:58 »

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.

Offline Longarmx
« Reply #2 - Posted 2014-08-23 21:47:44 »

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.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Akinesis

Senior Newbie

Exp: 3 years

« Reply #3 - Posted 2014-08-24 11:42:43 »

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.


What doesn't kill you, give you XP.
Offline basil_

« JGO Bitwise Duke »

Medals: 418
Exp: 13 years

« Reply #4 - Posted 2014-08-24 20:22:02 »

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


// render transparent things


probably not working tho Wink ... you would probably get z-fighting next.
Pages: [1]
  ignore  |  Print  

hadezbladez (335 views)
2018-11-16 13:46:03

hadezbladez (177 views)
2018-11-16 13:41:33

hadezbladez (336 views)
2018-11-16 13:35:35

hadezbladez (81 views)
2018-11-16 13:32:03

EgonOlsen (2175 views)
2018-06-10 19:43:48

EgonOlsen (2203 views)
2018-06-10 19:43:44

EgonOlsen (1376 views)
2018-06-10 19:43:20

DesertCoockie (2008 views)
2018-05-13 18:23:11

nelsongames (1646 views)
2018-04-24 18:15:36

nelsongames (2297 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!