gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
770 stars 179 forks source link

S2DEX: all issues listed here please! #1898

Closed olivieryuyu closed 5 years ago

olivieryuyu commented 6 years ago

1896

1897

1870

1869

1695

1619

936

1518

315 (is it ucode issue though?)

329

133

gonetz commented 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.

CallistoNTG commented 5 years ago

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. body_harvest-012 body_harvest-013 mariokart64-002

theboy181 commented 5 years ago

https://www.supermodel3.com/Forum/posting.php?mode=reply&f=7&t=1589

gonetz commented 5 years ago

I'm not registered on this forum. Please copy there.

Jj0YzL5nvJ commented 5 years ago

@theboy181 was referring to this.

gonetz commented 5 years ago

N64 has similar mechanism for Microtexture - detail textures for mip-mapping. But how it is related to texture filtering?

gizmo98 commented 5 years ago

@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.

CallistoNTG commented 5 years ago

@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.

gonetz commented 5 years ago

@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.

gizmo98 commented 5 years ago

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.

theboy181 commented 5 years ago

Pictures please. Can’t test and I’m very interested in the results. :)

gizmo98 commented 5 years ago

@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: body_harvest-006 body_harvest-009 conker_bfd-028 conker_bfd-030 kirby64-025 perfect_dark-013 puyopuyo4-038 puyopuyo4-040 puyopuyo4-043 puzzle_league_n64-004 yoshi_story-033

Bilinear filtering: body_harvest-001 body_harvest-005 conker_bfd-023 conker_bfd-026 kirby64-023 mariokart64-039 mariokart64-041 mariokart64-040 perfect_dark-011 puyopuyo4-033 puyopuyo4-035 puyopuyo4-037 puzzle_league_n64-001 yoshi_story-027 yoshi_story-029 zelda_majora s_mask-019 zelda_majora s_mask-021

theboy181 commented 5 years ago

This looks GREAT! .. Are there any regressions?

gizmo98 commented 5 years ago

@theboy181 I have not seen regressions till now.

theboy181 commented 5 years ago

Looking good.. whats next?

gizmo98 commented 5 years ago

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.

theboy181 commented 5 years ago

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. :)

gonetz commented 5 years ago

@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.

olivieryuyu commented 5 years ago

@gonetz

current patreon version for S2DEX

new issue in Ready Rumble 2

gliden64_ready_to_rumble_001

gonetz commented 5 years ago

Close this ticket because of many off-topic messages. Continue in #1971