Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S2DEX: all issues listed here please! #1898

Closed
olivieryuyu opened this issue Aug 22, 2018 · 120 comments
Closed

S2DEX: all issues listed here please! #1898

olivieryuyu opened this issue Aug 22, 2018 · 120 comments

Comments

@olivieryuyu
Copy link

olivieryuyu commented Aug 22, 2018

#1896
#1897
#1870
#1869
#1695
#1619
#936
#1518
#315 (is it ucode issue though?)
#329
#133

@olivieryuyu
Copy link
Author

image

bomberman 2

@theboy181
Copy link

What is the best way for me to know what is caused from s2dex and what isn’t?

@olivieryuyu
Copy link
Author

use Ricevideo debug plugin and see which ucode is used. At least you know which games uses which ucode.

@theboy181
Copy link

I noticed that Pokémon puzzle has issues in most BGs was unsure if it was related

@theboy181
Copy link

Rice debug. ? Info on how to use it please.

@olivieryuyu
Copy link
Author

olivieryuyu commented Aug 22, 2018

download and use it

@olivieryuyu
Copy link
Author

olivieryuyu commented Aug 22, 2018

also worms and kirby have issues with upscaling. Nintama Randou logo is sligthy wrapped.

@Kidboy17
Copy link

Kirby also has the issue where the screen bounces up and down in full screen mode.

@gizmo98
Copy link
Contributor

gizmo98 commented Aug 23, 2018

#1695 and Bomberman are fixed with 2D_fixes branch.
bomberman64u2-005

@olivieryuyu
Copy link
Author

@gizmo98 yes but in native :)

@gizmo98
Copy link
Contributor

gizmo98 commented Aug 23, 2018

Yep. Kirby only in native. Just a question. Should native be forced in Gliden64.custom.cfg as long there is no better fix?

@olivieryuyu
Copy link
Author

sergey to decide but I would say no.

@theboy181
Copy link

Really need to fix scaling. I don’t see a purpose to hle plugin if you have to run at lowered resolutions

@gizmo98
Copy link
Contributor

gizmo98 commented Aug 23, 2018

@theboy181
Only until there is a better fix for this game. It must be weighed if hires with broken 2D elements is better than a clean low res image.

@theboy181
Copy link

What do we think the issue is? Is it some sort of non interger upscaling?

@gonetz
Copy link
Owner

gonetz commented Aug 24, 2018

Yep. Kirby only in native. Just a question. Should native be forced in Gliden64.custom.cfg as long there is no better fix?

I think, no. The issue not so severe to force user play in low-res.

@theboy181
Copy link

I reported that there seems to be some sort of extra pixels pushed to the screen when hle is getting used. This might be the reason we see so many scaling issues. Refer to al and al+. @barracuda has issues with this too. OpenGL issue perhaps?

@olivieryuyu
Copy link
Author

most likely due to scissor not applied

@theboy181
Copy link

Anyway that can be tested?

@olivieryuyu
Copy link
Author

It will at one point in time

@theboy181
Copy link

Barracuda was mentioning that the math for output needs to account for the tool bars and everything. Would it not be a good idea to look at how al handles the windowed resolution?

@theboy181
Copy link

Hey, I have made a list of microcodes and linked them on Discord. This should help when looking for regressions, and what games might share the same microcode.
https://docs.google.com/spreadsheets/d/1YDOmzdcbnNLncehKfh4O3bkaTfGgWQgr1Wraxtrq4Zg/edit?usp=sharing

@theboy181
Copy link

theboy181 commented Aug 25, 2018

Here is the s2dex list compiled from the doc above

--
AI Shougi 3 (J)
Bakuretsu Muteki Bangaioh (J)
Battlezone - Rise of the Black Dogs (U)
Bomberman 64 - Arcade Edition (J)
Bomberman 64 - The Second Attack! (U)
Command & Conquer (U)
Destruction Derby 64 (U)
Doraemon 2 - Nobita to Hikari no Shinden (J)
GT 64 - Championship Edition (U)
Hamster Monogatari 64 (J)
Jinsei Game 64 (J)
Kirby 64 - The Crystal Shards (U)
Magical Tetris Challenge (U)
Magical Tetris Challenge featuring Mickey (J)
Neon Genesis Evangelion (J)
Nintama Rantarou 64 Game Gallery (J)
Nintama Rantarou 64 Game Gallery (J)
Nushi Duri 64 - Shiokaze ni Notte (J)
Ogre Battle 64 - Person of Lordly Caliber (U) (V1.0)
Parlor! Pro 64 - Pachinko Jikki Simulation Game (J)
Pokemon Puzzle League (U)
Polaris SnoCross (U)
Pro Mahjong Tsuwamono 64 - Jansou Battle ni Chousen (J)
Puyo Puyon Party (J)
Resident Evil 2 (U) (V1.0)
Resident Evil 2 (U) (V1.1)
SD Hiryuu no Ken Densetsu (J)
Snowboard Kids 2 (U)
Star Soldier - Vanishing Earth (U)
Susume! Taisen Puzzle Dama - Toukon! Marutama Chou (J)
The Legend of Zelda - Majora's Mask - Collector's Edition (U) (GC)
The Legend of Zelda - Majora's Mask (U)
V-Rally Edition 99 (U)
Wildwaters (Unreleased)
Worms - Armageddon (U) (M3)
Yoshi's Story (U) (M2)

@theboy181
Copy link

theboy181 commented Aug 26, 2018

Puyo Puyon Party (J)
Angrylion (reference)
image

GLideN64 3.0
image

GLideN64 2dfix branch

image

This game have black outlines on all the text, and 2d items making it look horrible.

@theboy181
Copy link

theboy181 commented Aug 26, 2018

Hamster Monogatari 64 (J)
AL (reference)

image

GLideN64 2d Fix Branch

image

@gonetz
Copy link
Owner

gonetz commented Sep 4, 2018

New test build from 2D_fixes branch:
https://drive.google.com/file/d/1pmy0ZrGoXsl13s8nia6Vky-9ract42Da/view?usp=sharing

Important note: the goal of fixes in 2D_fixes branch is to remove HLE-specific issues. If some graphics glitch presents in LLE mode, it most likely will remain until deeper repairing.

@gizmo98
Copy link
Contributor

gizmo98 commented Sep 4, 2018

I don't see texture seams and lines in Hamster Monogatari 64 (J) if nativeRes=1. I have not tested any other setting.

@theboy181
Copy link

Good to hear. I have not had anytime since I got back home to look. But I’m excited

@theboy181
Copy link

theboy181 commented Sep 5, 2018

Hamster64 still looks bad

image

EYE! see issues here too

image

@olivieryuyu
Copy link
Author

@TheBoy

Is there a difference with angrylion? I canot see any.

@gonetz
Copy link
Owner

gonetz commented Oct 19, 2018

Ok. Actual formula for smoothstep is simpler:
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/smoothstep.xhtml

@gizmo98
Copy link
Contributor

gizmo98 commented Oct 19, 2018

Ok. Smoothstep from gl4 looks the same:

name.a = clamp((name.a - 0.35) / 0.65, 0.0, 1.0 );
name.a = name.a * name.a * ( 3.0 - 2.0 * name.a );			

Iquilezles version is "smootherstep" -> http://sol.gfxile.net/interpolation/

It makes everything a little bit more smooth ;-)
snipimage

@gizmo98
Copy link
Contributor

gizmo98 commented Oct 20, 2018

Sergey do you think this is ready to be used? I could tidy everything and open a PR. Two extra notes about my current code.

  • I use Quilez bilinear filter implementation because i found it better readable without TEX_OFFSET macro and step functions http://www.iquilezles.org/www/articles/hwinterpolation/hwinterpolation.htm. Filtering result is the same.
  • I disable color bleeding and alpha clamping/smoothing if fbFixedAlpha is 1 because name.a will always be set to 0.825 if fbFixedAlpha is 1.

@gonetz
Copy link
Owner

gonetz commented Oct 20, 2018

Stefan, it is almost ready:

  • is it possible to make it work that good for 3point filtering?
  • if statements need to be rewritten (with step?)

@CallistoNTG
Copy link

CallistoNTG commented Oct 20, 2018

Unfortunately, this does cause some pretty notable issues even in games where it provides a benefit. For example, while it fixes the pink outline on some 2D elements in Body Harvest, it causes the map to look really wrong.
Master:
body_harvest-008
Branch filtertest3:
body_harvest-006

@gonetz
Copy link
Owner

gonetz commented Oct 20, 2018

Serious argument, thanks!

@gizmo98
Copy link
Contributor

gizmo98 commented Oct 20, 2018

@CallistoNTG
Good point. I will check body harvest. Please use filtertest2 because the other branch was just a test.

@gizmo98
Copy link
Contributor

gizmo98 commented Oct 23, 2018

@gonetz
I think i know why this is happening. Color bleeding should only be enabled if uAlphaCompareMode = 1. If i discard alpha == 0 texels 3/4 of the body harvest map disappears.
http://fgfc.ddns.net/PerfectGold/SetOtherMode_L.htm

@gonetz
Copy link
Owner

gonetz commented Oct 23, 2018

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
Copy link

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
Copy link

@gonetz
Copy link
Owner

gonetz commented Oct 24, 2018

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

@Jj0YzL5nvJ
Copy link
Contributor

@theboy181 was referring to this.

@gonetz
Copy link
Owner

gonetz commented Oct 24, 2018

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

@gizmo98
Copy link
Contributor

gizmo98 commented Oct 24, 2018

@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
Copy link

@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
Copy link
Owner

gonetz commented Oct 25, 2018

@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
Copy link
Contributor

gizmo98 commented Oct 25, 2018

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
Copy link

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

@gizmo98
Copy link
Contributor

gizmo98 commented Oct 27, 2018

@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
Copy link

This looks GREAT! .. Are there any regressions?

@gizmo98
Copy link
Contributor

gizmo98 commented Oct 27, 2018

@theboy181 I have not seen regressions till now.

@theboy181
Copy link

Looking good.. whats next?

@gizmo98
Copy link
Contributor

gizmo98 commented Oct 27, 2018

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
Copy link

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
Copy link
Owner

gonetz commented Oct 29, 2018

@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
Copy link
Author

olivieryuyu commented Dec 7, 2018

@gonetz

current patreon version for S2DEX

new issue in Ready Rumble 2

gliden64_ready_to_rumble_001

@gonetz
Copy link
Owner

gonetz commented Dec 23, 2018

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

@gonetz gonetz closed this as completed Dec 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants