Closed olivieryuyu closed 5 years ago
May be, may be. I'm not sure that uAlphaCompareMode will be enabled for all cases we are trying to solve, but I can't find a counter-example. Ok, let's use that fix for bilinear only if uAlphaCompareMode = 1.
Filtertest5 seems promising. However, while it fixes Body Harvest and Quest 64 and probably a few others, there are some issues such as trees having black outlines in Mario Kart 64.
I'm not registered on this forum. Please copy there.
@theboy181 was referring to this.
N64 has similar mechanism for Microtexture - detail textures for mip-mapping. But how it is related to texture filtering?
@CallistoNTG I modify texels with alpha = 0.0 only if uEnableAlphaTest = 1 or uAlphaCompareMode = 1. Mario Kart and some other games like Hamster 64 do something else. Color bleeding should not be done if the modified texel is visible (body harvest map and mario kart character selection screen). It should only be done if alpha value is really used for transparency. uEnableAlphaTest and uAlphaCompareMode are two flags which can be used. Don't know if there a varibles which can be used for MK64.
@gizmo98 At the very least, this current version seems to fix SOME issues with no side effect as far as I can tell. So that's good.
@gizmo98 you may use forceBlend flag as well. That is uEnableAlphaTest = 1 or uAlphaCompareMode = 1 or gDP.otherMode.forceBlender != 0. Currently gDP.otherMode.forceBlender is not passed as separate uniform. It as passed either as uForceBlendCycle1 for 1Cycle mode or as uForceBlendCycle2 for 2Cycle mode. You may add another uniform, uForceBlend, pass gDP.otherMode.forceBlender to it and check it in filtering shader. May be it will help to increase number of cases where filtering fix is applicable.
I added a cvgXAlpha check because all TEX_EDGE render modes use it. Mario Kart trees looks better now. I have not seen a regression till now (filtertest5).
if( uEnableAlphaTest = 1 || uCvgXAlpha = 1 )...
I will check forceBlender.
Pictures please. Can’t test and I’m very interested in the results. :)
@theboy181 filtertest5 (https://github.com/gonetz/GLideN64/compare/master...gizmo98:filtertest5?expand=1) mixes premultiplied alpha rgb values if( uEnableAlphaTest = 1 || uCvgXAlpha = 1 ). This works with 3-Point filtering and bilinear filtering. It does not fix hamster 64 start screen in highres.
3-Point filtering:
Bilinear filtering:
This looks GREAT! .. Are there any regressions?
@theboy181 I have not seen regressions till now.
Looking good.. whats next?
I think if Sergey thinks this could be a way to go we should test this thorough. If everything is ok it can be merged then.
I also tested forceBlender but i had issues with translucent elements in body harvest. Premultiplied alpha makes everything black if alpha = 0.
Any talk about fixing the texture aliment issues? This thread has vastly improved GLideN64. Just need to focus on the other issues that cause the textures to get cutoff now. :)
@gizmo98 , please make a PR with your fixes. It should contain a few clean commits. I'll push it to a branch, so test builds can be taken from AppVeyor autobuild. We will wait for feedback and eventually merge the changes to master, may be as optional feature. I need to get feedback about performance impact on mobile devices.
@gonetz
current patreon version for S2DEX
new issue in Ready Rumble 2
Close this ticket because of many off-topic messages. Continue in #1971
1896
1897
1870
1869
1695
1619
936
1518
315 (is it ucode issue though?)
329
133