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

PPSSPP: Linear Texture Filtering broken in Tekken 6 since v0.9.1-2045-ga3f2fcf #4405

Open
solarmystic opened this issue Nov 2, 2013 · 18 comments
Labels
GE emulation Backend-independent GPU issues
Milestone

Comments

@solarmystic
Copy link
Contributor

Issue is as stated above. Responsible commit is 4567aca by @danyalzia merged into master with v0.9.1-2045-ga3f2fcf a3f2fcf by @hrydgard

Setting texture filtering to Linear or Linear on FMV doesn't work anymore for Tekken 6 since then, both ingame and during FMVs:

(click on the screenshots to observe the issue clearly)

FMV (pixellated even after Linear Filtering is forced in the graphics menu):
screen00192

Ingame menu (letters remain pixellated even when Linear Filtering is forced in the Graphics menu):
linfail2045

Last working revision is v0.9.1-2043-g99d4ef1 99d4ef1

FMV (smoothed out as expected):
screen00193

Ingame menu (letters are smoothed out as expected with Linear Filtering)
works2043

I suspect other games may be affected by this commit too. Will add them into the issue report if and when I find them.

Tested on the following machine:

sysspec

@solarmystic
Copy link
Contributor Author

Soul Calibur is also affected by this issue it seems.

(Observe the text in the red box)

Working as expected with v0.9.1-2043-g99d4ef1 99d4ef1 (smoothed letters when Linear Filtering is selected)
scworks

Broken in v0.9.1-2045-ga3f2fcf a3f2fcf (pixellated letters even with Linear Texture Filtering selected):
scfail

@unknownbrackets
Copy link
Collaborator

Why would the game use alpha testing for video? Well, it might be "enabled" but not really doing anything. I guess we could try harder to detect those cases.

Or just give up and let filtering break things at 2x.... which ain't great.

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Nov 2, 2013

That would probably be the same reason as always - alpha testing and color testing are free on the PSP so games sometimes just leave them on by accident, probably just forgetting to disable the state, as there's no harm anyway if you draw things that don't match the test criterion.

But yeah there are more checks we can do to rule out effects of these, and use the result of those checks for the linear filter enabling...

@Antonio1994
Copy link

It broke MGS PW too. Changing texture filter doesn't make any difference....

@hrydgard
Copy link
Owner

hrydgard commented Nov 3, 2013

Broke the filtering in MGS PW or broke the game? That's some ambiguous wording.

@Antonio1994
Copy link

Uh....sorry...I meant it broke the filtering....my mistake! :)

@unknownbrackets
Copy link
Collaborator

How's the status of this? I recall there were related changes recently.

-[Unknown]

@solarmystic
Copy link
Contributor Author

The filtering works in FMVs now, but forcing Linear Filtering still does nothing for the pixelated ingame fonts. Same thing for Soul Calibur Broken Destiny.

@Antonio1994
Copy link

I dont know have you guys tryed it, but in MGS when I get in-game and exit fullscreen and enter fullscreen again the filtering works.....

@unknownbrackets
Copy link
Collaborator

Does using something more like this help?

    if (g_Config.iTexFiltering == LINEARFMV && g_iNumVideos > 0 && (entry.dim & 0xF) >= 9) {
        magFilt |= 1;
        minFilt |= 1;
    }
    if (g_Config.iTexFiltering == LINEAR && !gstate.isColorTestEnabled()) {
        if (!gstate.isAlphaTestEnabled() || entry.GetAlphaStatus() == TexCacheEntry::STATUS_ALPHA_FULL || !gstate.isTextureAlphaUsed()) {
            magFilt |= 1;
            minFilt |= 1;
        }
    }

-[Unknown]

@solarmystic
Copy link
Contributor Author

@unknownbrackets Just adding those lines in? Or do I have to replace any prior lines with these ones?

In any case, appending those lines to the current master version of the file does not resolve the issue. Lnear Texture Filtering is still broken for the ingame fonts in Tekken 6.

@unknownbrackets
Copy link
Collaborator

Replacing the if block that starts with g_Config.iTexFiltering == LINEAR with those. But, these should apply separately anyway. That means we can't safely force linear filtering because it's inventing pixels that may have other alpha values than the game expects.

Or we could make it ignore that and people will complain about the green outlines around characters or etc. in some games again.

-[Unknown]

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue May 16, 2014
If we know that the test is trivially true, we don't need to worry about
the test.  May help hrydgard#4405.
@solarmystic
Copy link
Contributor Author

@unknownbrackets Unfortunately, #6088 doesn't resolve the issue in Tekken 6 for the pixelated fonts. Setting it to Linear still causes it to be pixelated.

ulus10466_00009

Again, a reminder of what it used to look like with Linear Filtering set:-

ulus10466_00010

Seems to be the only straggler though. Other games have functioning Linear Filtering now when forced in the options.. (like Crisis Core etc.)

@unknownbrackets
Copy link
Collaborator

Well, I think that means it's using alpha test in a way that we can't know that we can safely ignore.

-[Unknown]

@ppmeis
Copy link
Contributor

ppmeis commented Jul 25, 2015

Testing with latest build. Same status:
tekken6linearfilter

@unknownbrackets
Copy link
Collaborator

So, thinking about this, I guess what we could do is use sampler objects (GL3.3+ / GLES3) to bind the texture in two slots, and then do BOTH nearest and linear.

That way, we could do color and alpha testing based on the nearest value, but still output the linear value. I think that's more or less staying true to the goals of higher render resolutions.

We could take this further, and when upscaling (not not texture replacements? not sure...), we could bind the original texture to the second slot. This would again allow for using nearest which would give us better chances of color tests and alpha tests working correctly.

-[Unknown]

@hrydgard
Copy link
Owner

Yeah, that's definitely a possibility, although the mix between smooth filtering inside the solid regions coupled with the hard edges against the surroundings might look odd. Also, if the test is done against an ugly color it would still be able to bleed into the solid region.

@ghost
Copy link

ghost commented Sep 14, 2021

Auto Max Quality possible help this?

@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label Sep 14, 2021
@hrydgard hrydgard added this to the Future milestone Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
Development

No branches or pull requests

5 participants