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

Sengoku Cannon - pink graphics problem on stage 2 #10914

Open
Panderner opened this issue Apr 14, 2018 · 15 comments
Open

Sengoku Cannon - pink graphics problem on stage 2 #10914

Panderner opened this issue Apr 14, 2018 · 15 comments
Labels
Depth / Z Issue involves depth drawing parameters. GE emulation Backend-independent GPU issues Guardband / Range Culling Involves vertices outside fustrum.
Milestone

Comments

@Panderner
Copy link
Contributor

The game works pretty well there a issue a pink thing appeared in stage 2

@Panderner
Copy link
Contributor Author

screenshot_2018-04-14-21-39-52

@unknownbrackets
Copy link
Collaborator

Are you using the latest git build? Does this happen with both Vulkan and OpenGL?

Could you try exporting a GE debugger dump on PC?

To do this, open the game and select Debug -> GE debugger..., then when it's displaying the scene, press Record in the top right. After a second or so, it'll finish and save a trace of the drawing activity.

After that, check the memstick/PSP/SYSTEM/DUMP folder and it'll have created a file named something like "ULES12345_0000.ppdmp". You can zip that and then drag and drop it into a reply here.

-[Unknown]

@benderscruffy01
Copy link

v1.8.0-17-g737be61f9
still happens
DUMP.ZIP

@hrydgard hrydgard added this to the v1.9.0 milestone Mar 24, 2019
@hrydgard hrydgard changed the title Sengoku Cannon Sengoku Cannon - pink graphics problem on stage 2 Aug 6, 2019
@hrydgard
Copy link
Owner

hrydgard commented Aug 6, 2019

Still happens? All graphics backends or just some?

@hrydgard hrydgard modified the milestones: v1.9.0, v1.10.0 Aug 6, 2019
@Panderner
Copy link
Contributor Author

Still happens on 1.9.2

@unknownbrackets
Copy link
Collaborator

In the dump I picked, it looks like this is caused by draw 2/34. It looks the same as the correct PSP rendering if you skip that draw (below is the PSP rendering):

ULJM05021_#10914_sengoku_pink

The draw:

  • Depth clamp, viewport 32767 -32768, no minz/maxz
  • No texturing or frag color, verts are just normal/pos, both float
  • Cull: front (CW)
  • Fog: 19000 / 0.000053 f3dbbc (small impact on color of purple curtain)
  • Alpha blend: standard src.a / inverse src.a
  • Alpha test: a > 0
  • Depth test: src >= dst (framebuffer has all zero depth)
  • Actual color comes from lighting. Light 0 is enabled but does not really do anything. Curtain would be black without lighting, but still draw.
  • Material alpha is ff, but if it was 00 it'd ignore the draw.
  • Triangle strip, 34 verts. If it was 20, it'd be fine. If it was 21, you'd see less curtain.

If I force it to render from vaddr + 18 verts and limit to 3 verts, you still see the curtain. These are the verts:

X               Y               Z               NX              NY              NZ
56.827881	45.151855	-134.152344	0.000000	0.000000	1.000000
57.825562	1843.213379	-133.964844	0.000000	0.000000	1.000000
276.011719	166.368652	39.826172	0.000000	0.000000	1.000000

If depth clamp was off, this would not get drawn. What's confusing to me is that the X/Y/Z the GE debugger shows doesn't overlap the area you see the curtain in at all. It is at least CCW.

This happens in all backends, including software rendering. Maybe there's an interaction with cullmode and the clipping that depth clamp does... but I'm still confused why this shows up on the right side of the screen, when the max (transformed) X is 276.

-[Unknown]

@hrydgard hrydgard modified the milestones: v1.10.0, v1.11.0 Apr 26, 2020
@hrydgard hrydgard added Guardband / Range Culling Involves vertices outside fustrum. GE emulation Backend-independent GPU issues labels Nov 11, 2020
@hrydgard hrydgard modified the milestones: v1.11.0, v1.12.0 Nov 11, 2020
@hrydgard hrydgard modified the milestones: v1.12.0, Future Aug 12, 2021
@unknownbrackets
Copy link
Collaborator

The rules noted in #12058 (speciifcally clipping) appear to fix this, at least in the software renderer.

-[Unknown]

@ghost
Copy link

ghost commented Oct 15, 2021

Software Rendering
Screenshot_2021-10-15-08-34-50-305_org ppsspp ppssppgold
v1.12.2-9

@unknownbrackets
Copy link
Collaborator

Is that a slightly different frame? I suspect a particular precision issue, so it'd be good to get this right. I think it's related to clipping. Or is this wrong even with the original dump for your device?

It might be good to upload a couple frame dumps of different frames showing the fuschia / purple in different ways, to give more cases to test.

-[Unknown]

@ghost
Copy link

ghost commented Aug 1, 2022

Hardware
Screenshot_2022-08-01-17-34-15-648_org ppsspp ppsspp

Software
Screenshot_2022-08-01-17-35-19-968_org ppsspp ppsspp

@unknownbrackets
Copy link
Collaborator

Frame dumps reproducing the remaining glitches in the software renderer would be helpful. The current one looks okay, so it's hard to know what's still off.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Okay, so this actually seems to be another triangle inversion case, I think. See: #16207 (comment), also #16131.

If I throw away all polygons that clip between negative and positive w, it looks good in that frame dump.

The PSP definitely doesn't throw all away, haven't figured out what the rule is yet.

-[Unknown]

@hrydgard
Copy link
Owner

Isn't it still happening in the hardware renderer?

@ghost
Copy link

ghost commented Nov 20, 2022

I can still reproduce this using the dump.
Screenshot_20221120_185948_2f85358b2198d26f8aca533d68bee793

@hrydgard hrydgard removed this from the Future milestone Nov 20, 2022
@hrydgard hrydgard added this to the Future-Prio milestone Nov 20, 2022
@unknownbrackets
Copy link
Collaborator

It feels like I would need geometry shaders or software transform to fix this for hardware, assuming the remaining cases are inversions...

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Depth / Z Issue involves depth drawing parameters. GE emulation Backend-independent GPU issues Guardband / Range Culling Involves vertices outside fustrum.
Projects
None yet
Development

No branches or pull requests

4 participants