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

olivieryuyu commented 6 years ago

image

bomberman 2

theboy181 commented 6 years ago

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

olivieryuyu commented 6 years ago

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

theboy181 commented 6 years ago

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

theboy181 commented 6 years ago

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

olivieryuyu commented 6 years ago

download and use it

olivieryuyu commented 6 years ago

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

Kidboy17 commented 6 years ago

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

gizmo98 commented 6 years ago

https://github.com/gonetz/GLideN64/issues/1695 and Bomberman are fixed with 2D_fixes branch. bomberman64u2-005

olivieryuyu commented 6 years ago

@gizmo98 yes but in native :)

gizmo98 commented 6 years ago

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

olivieryuyu commented 6 years ago

sergey to decide but I would say no.

theboy181 commented 6 years ago

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

gizmo98 commented 6 years ago

@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 commented 6 years ago

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

gonetz commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

most likely due to scissor not applied

theboy181 commented 6 years ago

Anyway that can be tested?

olivieryuyu commented 6 years ago

It will at one point in time

theboy181 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Hamster Monogatari 64 (J) AL (reference)

image

GLideN64 2d Fix Branch

image

gonetz commented 6 years ago

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 commented 6 years ago

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

theboy181 commented 6 years ago

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

theboy181 commented 6 years ago

Hamster64 still looks bad

image

EYE! see issues here too

image

olivieryuyu commented 6 years ago

@theboy

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

theboy181 commented 6 years ago

Take a look at the white Chinese character in the middle of the title. You will see that an entire row of pixels are missing.

theboy181 commented 6 years ago

@olivieryuyu

image

gizmo98 commented 6 years ago

@theboy181 i know what you mean. Some games have seams at the moment. 2D_fixes does not have this problem but some textures look cut of. It looks better than seams but not correct. I have not found a way to fix this.

theboy181 commented 6 years ago

No seams looks hella better! But it would be nice to get all required pixels to show. :(

gonetz commented 6 years ago

1869 is not S2DEX related. The same issue is in LLE.

gizmo98 commented 6 years ago

@theboy181 i have no final Hamster64 fix. With my current test branch initial text looks better and title screen text looks better but the right hamster is cut in two. ;-) ___________64-002 ___________64-004 I will take a look if i can remove the line.

theboy181 commented 6 years ago

@gizmo98

I just built your branch from 20 hours ago, and the issues are still present in non Native modes, is that to be expected?

The attachment also look very different in Native mode on my system, however the logo when the game started looked correct. image

theboy181 commented 6 years ago

@gizmo98 turn up AA to max to see my results.

gizmo98 commented 6 years ago

@theboy181 This should not happen and i will only open a PR if all issues are fixed. 😉

theboy181 commented 6 years ago

@gizmo98 can you enable issues for your GLideN64 forks? I thinks its better for me to leave feedback directly on your Git.

Your changes seem to only impact native resolution, and I don't see using any other plugin than AL+ if I do that.

"@theboy181 This should not happen and i will only open a PR if all issues are fixed. 😉"

what do you mean this should not happen? Turn on AA to MAX in the settings.

gizmo98 commented 6 years ago

@theboy181 i mean it can happen at the moment but it should not happen with a final fix.

theboy181 commented 6 years ago

@gonetz I'm loving that you included the 2d Fixes in Master its starting to look good now. I am still very confused on why most games are missing entire lines of pixels (even in Native resolution)

I really am starting to believe that the up scaling is not integer and is the leading cause of the remaining issues.

image

are you able to comment on what the issue might be? Have you compare the resolution between AL, and GLideN64 to see what might be causing this issue?

theboy181 commented 6 years ago

@gizmo98

image

Your Branch at NATIVE looks correct!! Good Job!!

theboy181 commented 6 years ago

@gizmo98 6x scaling not so much.

image

gonetz commented 6 years ago

@gonetz I'm loving that you included the 2d Fixes in Master its starting to look good now. I am still very confused on why most games are missing entire lines of pixels (even in Native resolution)

I'm confused too.

gizmo98 commented 6 years ago

@theboy181 is this 2D_fixes branch behavior a regression compared to last wip build or is the fix not 100% correct atm? Could you take a screenshot?

@gonetz Hamster64 seems to use gSPBgRect1Cyc(). G_OBJRM_BILERP is not set but gDP.otherMode.textureFilter == G_TF_BILERP or G_TF_AVERAGE is. If i add coord correction for gDP.otherMode.textureFilter == G_TF_BILERP and G_TF_AVERAGE text in Hamster64 intro has no black rim and some textures are not cut of anymore. I need to find the right combination to fix this game without breaking any other. I'm working on it.

gizmo98 commented 6 years ago

@gonetz Hamster64 texture borders look correct if i add coord correction an force textureParameters::WRAP_CLAMP_TO_EDGE with

pCurrent->clampS = 1;
pCurrent->clampT = 1;

___________64-009

Yoshi's story and Bakuretsu Muteki Bangaioh (J) look broken. They need textureParameters::WRAP_REPEAT to repeat background texture patterns over the whole screen. Do you have any idea how to fix texture border sampling or if there is a equivalent rsp or rdp flag for clamping and repeating? Is it possible to add a real border (double first and last pixel line so bilinear filter can fetch right color values at borders).

gonetz commented 6 years ago

This issue reminds me problems I had to solve with texrect, GraphicsDrawer::drawTexturedRect The code calculates S and T coordinates, and then it does some magic:

                if ((cache.current[t]->mirrorS == 0 && cache.current[t]->maskS == 0 &&
                    (texST[t].s0 < texST[t].s1 ?
                    texST[t].s0 >= 0.0 && texST[t].s1 <= (float)cache.current[t]->width :
                    texST[t].s1 >= 0.0 && texST[t].s0 <= (float)cache.current[t]->width))
                    || (cache.current[t]->maskS == 0 && (texST[t].s0 < -1024.0f || texST[t].s1 > 1023.99f)))
                    texParams.wrapS = textureParameters::WRAP_CLAMP_TO_EDGE;

                if (cache.current[t]->mirrorT == 0 &&
                    (texST[t].t0 < texST[t].t1 ?
                    texST[t].t0 >= 0.0f && texST[t].t1 <= (float)cache.current[t]->height :
                    texST[t].t1 >= 0.0f && texST[t].t0 <= (float)cache.current[t]->height))
                    texParams.wrapT = textureParameters::WRAP_CLAMP_TO_EDGE;

These are hacks. May be we need similar hacks/heuristics there.

gizmo98 commented 5 years ago

@gonetz thank you for the hint!

@theboy181 Please try the following branch. It should fix cut off textures and Hamster64. https://github.com/gonetz/GLideN64/compare/master...gizmo98:bgclamp?expand=1

gizmo98 commented 5 years ago

I have found something about outlines around transparent textures if higher resolutions are used (for example hamster64, Puyo Puyon Party): http://www.adriancourreges.com/blog/2017/05/09/beware-of-transparent-pixels/ https://answers.unity.com/questions/10302/messy-alpha-problem-white-around-edges.html