Closed Helco closed 9 months ago
These artifacts do appear in Zanzarah but not always, e.g.
We have to investigate further, probably RW does some rendering and we have to figure out what it is. A new posibility for sorting might be:
And it gets worse: Some ferns are FOModel with EarlySolid instead of normal Model which does not just change the sorting, it also seems to change from AlphaBlend to Opaque Cutout. Is this because Models are drawn as part of the RWWorld?
The answer is of course as semi-satisfying as one would expect:
FOModelRenderType
With the corrections in 3485e1e I can close this issue at least until some clear buggy behavior in zzio is discovered. The original buggy situation with the tree tops is fixed.
As side-note: After fixing the actual bug there were black borders around the tree tops, not from blending inside the game but because the low-alpha values were written to the framebuffer to be blended with the ImGui Window. Using opaque color with additive alpha fixes this, but if we encounter similar issues this should be remembered.
Currently it seems that the original Zanzarah renders all models using alpha blend (SrcAlpha + InvSrcAlpha). This would cause obvious borders if not somehow mitigated as shown in the screenshot around the leave edges. ~These artifacts do not appear in the original Zanzarah.~
We should investigate why this bug does not happen in Zanzarah and implement an equal solution in zzio. Possibilities are:
This would currently trash most of the batching we have. The question here would be if Renderware implicitly sorts such atomics.
This might reduce some of the batcher trashing while still achieving good enough sorting. For this case we definitely should check whether the remaining artifacts (think about the ferns) happen in the original engine
I very well could have mistaken the RE'd code and models are actually drawn opaque (but probably with some MSAA+AlphaToCoverage)
This will neither be efficient, original nor simple. But an interesting possibility. (Unclear if this would work at all with most fragments being fully opaque)