Potential jme transparency Bug

I have a box when i render it with FaceCullMode.Off i get this result.

Some transparent parts of the model get culled even though its off.



Image with FaceCullMode.Off



Now if i do it with the second way :

create a box with FaceCullMode.Front.

clone it and add cloned material with FaceCullMode.Back

2 boxes



is this working as intented ?

For proper transparency, it is required that objects be sorted back to front. Sometimes this is impossible… for example when the object is double sided.



You can mitigate this somewhat by setting the alpha fall-off and alpha test on the Material’s getAdditionalRenderState(). This causes and transparent pixels to be discarded if their alpha is below a certain amount. In other words, without this even the transparent pixels are drawn and fill in the Z buffer… with alpha test, some are not even drawn.



That’s only a partial solution, though… since the filtered edges of things will sometimes still cause issues because their alpha value is higher than the alpha falloff.



In your case, it is better to use two one sided meshes rather than try to get one double-side mesh to work. If you ever get to attempting to light your stuff, having a separate inside and outside is better anyway since double sided faces always pick up their lighting from the front face.