I’ve a bunch of trees made up of two quads, which are scattered over the terrain. The SimpleTextured material with alpha.
The problem i’m having with them are twofold (but related i believe).
If one tree is in front of the other, the tree in the background is not visible where the forward quad covers it, even where it’s all non opaque.
If i use shadows (pssm for example), the shadow is blocked out in a similar way.
In JME2 this could be solved by changing the TestFunction. Looking into the RenderState class, there is such an enum (TestFunc), but it never seems to be used. How is it meant to be used?
Since i implemented the geometry instancing (see User Code), i’ve noticed the same issue, even though transparent bucket is on.
See image for reference:
A batch now consists of three trees, and in some cases the transparent polys stop the polys behind them from being drawn, and in some cases not. I could understand if it happened all the time, but there are apparently “Good” batches too.
Does it have to do with the index buffer? That in some cases i just get lucky that the polys get drawn in the “correct” order?