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

Shin Megami Tensei: Persona - The button outlines in the battle menu are drawn incorrectly #3871

Open
internetakias opened this issue Sep 22, 2013 · 38 comments
Labels
D3D9 Direct3D 9 D3D11 Direct3D 11 OpenGL Vulkan

Comments

@internetakias
Copy link

screen00371
As you can see in the above screenshot, the outlines adorning the buttons break at some point and become missaligned for whatever reason.
In software rendering, by the way. They don't appear at all:
screen00369
Also, I'm not sure if this is related but this happens in the P3P status screen:
BR ON
image
BR OFF:
image

@internetakias
Copy link
Author

Seems like the bug yields different results depending on wether BR is off or on
BR OFF:
screen00381
BR ON:
screen00380

@dbz400
Copy link
Contributor

dbz400 commented Sep 25, 2013

I think the question is ... Are these outlines exist on real PSP?

@internetakias
Copy link
Author

image
Yeah

@internetakias
Copy link
Author

Huh, seems like upscaling is the culprit here
1x res:
screen00382
Could this issue be related to #3332?

@dbz400
Copy link
Contributor

dbz400 commented Sep 25, 2013

So 2x or above will have outlines issue ? i think it is all default setting and no textures up-scaling stuff turned on

@internetakias
Copy link
Author

Texture scalling doesn't have anything to do with this issue, it seems. Also, almost all of the buttons except the Persona and Guard ones have the top part of the outline placed one pixel above where it should be. But when they are selected, the Persona and Guard buttons are the ones displaying incorrectly
screen00385
screen00383
screen00384

@dbz400
Copy link
Contributor

dbz400 commented Sep 25, 2013

I see. Therefore , it is the internal resolution issue , right ? 1x fine but 2x or above looks bad

@internetakias
Copy link
Author

Pretty much

@internetakias
Copy link
Author

Seems like on the latest build, the only difference between Buffered Rendering and Non-Buffered Rendering is that in Non-BR, all of the buttons are displaying incorrectly
screen00391

@internetakias
Copy link
Author

P2: Innocent Sin appears to be suffering from a similar issue
screen00392

@hrydgard
Copy link
Owner

we could try using a bigger line thickness when resolution is higher.

@internetakias
Copy link
Author

If you're talking about the bar on the top, I've already opened an issue for that: #3332
Anyway
BR OFF:
screen00394
The lines making up the buttons' outlines aren't connecting properly to each other. Also, Feral Claw's icon is overlapping with the selected skill below.
BR ON:
screen00395
Here most of the button outlines are displaying correctly, but the inside of the buttons is affected by the issue I mentioned above.
Strangely enough, the outlines on the character windows are displaying incorrectly in both modes

While I'm still at it, FXAA seems to be messing up the fonts and textures in a number of games:
screen00393

@unknownbrackets
Copy link
Collaborator

Hmm, makes sense. I wonder if points matter as well? Probably not so much.

Could probably just set the glLineWidth once per frame or on Resized.

-[Unknown]

@internetakias
Copy link
Author

I upgraded my PC today and I now have an NVIDIA GTX 760. So I'm here to report my findings:
When the Window Size and the Resolution are set to 1, the outlines appear correctly for the most part(the outline on the right side of the button is somewhat transparent)
screen00421
When the Window Size and Resolution are set to a value higher than 1, the outlines are displaying incorrectly again:
screen00422
Also, it seems like when the window size is set to 1, the higher the resolution is set to the more the outlines start dissapearing:

Rendering Resolution set to 2:
screen00424
Rendering Resolution set to 3:
screen00426
Rendering Resolution set to 10:
screen00423

@hrydgard
Copy link
Owner

hrydgard commented Oct 9, 2013

As I've said before, that's pretty normal. Running games at resolutions they don't expect doesn't always work flawlessly. It's possible that glLineWidth will make it look a little better though of course.

@dbz400
Copy link
Contributor

dbz400 commented Oct 9, 2013

I try in this way in GL_Resized() , not too sure if it is the correct way to do it .

glLineWidth(g_Config.iInternalResolution);

@internetakias , test build here
ppssppwindows

@hrydgard
Copy link
Owner

hrydgard commented Oct 9, 2013

You should probably set it to 1 if iInternalResolution is 0, otherwise that should be okay.

@dbz400
Copy link
Contributor

dbz400 commented Oct 9, 2013

Alright .

glLineWidth(g_Config.iInternalResolution == 0 ? 1 : g_Config.iInternalResolution);

@internetakias
Copy link
Author

@raven02
The link appears to be corrupted

@hrydgard
Copy link
Owner

hrydgard commented Oct 9, 2013

@internetakias , it's a file uploaded as a jpeg to work around github's rules, rename it to zip or something.

@dbz400
Copy link
Contributor

dbz400 commented Oct 9, 2013

I confirm it works pretty good . This is comparsion at 2x

-without glLineWidth
screen00026

-glLineWidth(2)
screen00024

@hrydgard
Copy link
Owner

hrydgard commented Oct 9, 2013

Unfortunately it is not supported in OpenGL ES so you will have to surround the call to glLineWidth with

#ifndef USING_GLES2
     glLineWidth( ... )
#endif 

I guess we should turn lines into triangles to make them fat on ES... sigh.

@dbz400
Copy link
Contributor

dbz400 commented Oct 9, 2013

I see.Will do and pull a request for it .

@dbz400
Copy link
Contributor

dbz400 commented Oct 9, 2013

I do think fatten lines into triangles would be better approach since there are quite many games have similar issues on Android that i observed .

@hrydgard
Copy link
Owner

hrydgard commented Oct 9, 2013

oh yeah. Try this quick approximation:

if (g_Config.iInternalResolution == 0) {
    glLineWidth(std::max(1, (int)(PSP_CoreParameter().renderWidth / 480)));
} else {
    glLineWidth(g_Config.iInternalResolution);
}

@dbz400
Copy link
Contributor

dbz400 commented Oct 9, 2013

I used yres and seems to be working okay :)

@hrydgard
Copy link
Owner

hrydgard commented Oct 9, 2013

Probably it's so large OpenGL rejects it because yres will be hundreds of pixels :)

@dbz400
Copy link
Contributor

dbz400 commented Oct 10, 2013

@internetakias , can you recheck and confirm the issue fixed?

@internetakias
Copy link
Author

Will do

@internetakias
Copy link
Author

Seems to work fine now.
screen00425

The outlines still don't connect properly with each other though. Even at 1x res
screen00427

@internetakias
Copy link
Author

By the way, I haven't checked on 0.9.6 yet, but it seems like raven's fix doesn't work for Android

@dbz400
Copy link
Contributor

dbz400 commented Dec 14, 2013

Yes , the fix is for windows only since GLES not support glLineWidth

@unknownbrackets
Copy link
Collaborator

The lines still look pretty bad in GLES in Persona 1. I'm not really sure why.

Some of the lines are missing in softgpu. It seems to be some glitch or overflow, because it thinks it's being asked to draw a line from 1023,4 - 128,4 (it really should be from 0,4 - 128,4.)

It's actually reading -1,4 - 128,4 from the vertex, but somehow it's wrapping that to 1023 in throughmode... hmm.

As for Persona 3, there's no outline in GLES right now (any resolution), which I think may be correct (I mostly only played the console version)? The outline does show in softgpu and isn't completely awful (assuming it should be there...), although it's not perfect at all.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

The outline in Persona 3 should not be there - it's antialiasing. With #9684, lines largely work in software rendering for all the above cases.

As far as other backends:

  • Persona 3: the outline in the menu is present, and incorrect (same issue as Summon Night 5 Only hand is wire frame.  #6483.)
  • Persona 1 and 2: the UI lines are incorrect, even at 1x. It seems like an origin issue: if all lines were drawn 0.5 pixels lower and to the right, it might work better. Width is also an issue.

Note that skip buffer effects ("non buffered rendering") essentially means increased render resolution, and both cause line width issues.

-[Unknown]

@ghost
Copy link

ghost commented Jun 4, 2020

Anyone can you upload a ge dump?

@unknownbrackets
Copy link
Collaborator

I haven't tested this, but #15076 may help.

-[Unknown]

@ghost
Copy link

ghost commented Nov 1, 2021

ppsspp v1.12.3-136

Vulkan
Screenshot_2021-11-01-20-07-56-209_org ppsspp ppsspp

Software
Screenshot_2021-11-01-20-10-53-740_org ppsspp ppsspp

@unknownbrackets
Copy link
Collaborator

Yeah, doesn't seem to be fixed.

For one of the outlines in the menu (not battle, but seems like the same problem), it uses 5 verts for a line strip:

-24,50 -> -24,32
-24,32 -> 109,32
109,32 -> 109,51
109,51 -> -24,50

Software rendering gets this right, but as you can see the problem is the strip has the bottom right corner slightly lower.

In hardware rendering, it looks like this though:

Offset line

Because it goes up halfway through the line. But the software rasterizer gets it right:

Straight line

The red highlighted area in both cases is a triangle strip, but essentially it's a rectangle from 0,33 -> 109,50. It does seem like somehow the top line (rightward) is still going upward, not downward as it should. The slanted line is the leftward line.

-[Unknown]

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Nov 4, 2021
Needs higher precision to change pixel at the right time.

This makes the lines in Persona 1 look right, see hrydgard#3871.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D3D9 Direct3D 9 D3D11 Direct3D 11 OpenGL Vulkan
Projects
None yet
4 participants