Transparency

Hi Everyone,

I have some problems when it comes to making my stitched meshes transparent:

As you can see some of the plants overlay the other plants correctly - but some just hide the plants behind them.
I guess that has something todo with the z-buffer?! Maybe it is even some kind of optimization as the engine thinks
that the parts behind the quads are not visible at all so it can just remove them.

Anyone has an idea how to get the jME to draw all parts of the plants?

Before anyone tries to solve this - I just by accident realized why this happens:

It’s because I didn’t discard too transparent fragments in the fragmentshader! So even if the pixel is transparent
the information that there is a pixel present at the position is stored in the zbuffer - and that prevents other pixels
to write to that position even if it is in fact invisible.

So make sure you have something similar like this in your fragmentshader:

[java]
if(alpha < 0.1){
discard;
}
[/java]

The happy result:

1 Like

Marked your topic as resolved for you :slight_smile:

<cite>@zarch said:</cite> Marked your topic as resolved for you :)

Thanks :slight_smile: