i’m setting up my project structure using jme and loaded a model (a palm) from opengamearts (dummy & test purpose) which has diffuse,normal and spec. pics.
It looks really nice but there is one blend error i do not understand.
I hope someone can help me and here we go:
I use a jython to setup my level. i dont know jet if i keep it but for modularity of my project it would be great.
It’s hard to tell for sure in this picture but it’s probably a polygon sorting issue. Since the lower leaf extends towards the camera then it sorts as being ahead of the other leaves and so will be drawn last when in the transparent bucket.
Even though the other leaves have transparent fringe, it’s still drawing pixels there and filling the Z-buffer… so when the lower leaf is drawn, it can only be seen where those other leaf polygons weren’t.
One way to mitigate this is to set the alpha falloff stuff on the extended render state.
This controls which pixels are drawn based on an alpha threshold… so the leaf fringe that is transparent will be discarded instead of being drawn fully transparent. In other words, the z-buffer won’t get filled. It’s still not a perfect solution if there is a part with lots of partial alpha as sometimes you will still see a halo around the leaves but it should be better than what is happening for you now.
Alpha to coverage will give a better result. The reason I usually don’t use it is because it requires AA… and with AA off it doesn’t seem to do anything at all so you are back to your original big black borders.
Maybe there is some threshold of the alpha test that isn’t visible when alpha to coverage is active but will be a nice fallback if AA is disabled. Or you can just force AA on always.