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

Asphalt 2: Glowing things draw through roads and walls (also range culling, worked around) #14299

Closed
5 tasks done
SecularSteve opened this issue Mar 16, 2021 · 20 comments
Closed
5 tasks done
Labels
Guardband / Range Culling Involves vertices outside fustrum.
Milestone

Comments

@SecularSteve
Copy link

What happens?

Easier just to show a link to a self-evident recording (sorry about the size, quality and all that), along with a screenshot:

https://ufile.io/ev5r1gux

ULES00719_00002

Basically, the artifacts still render weirdly (or disappear for a fraction of a second) when they get to the edges of the screen, some glowing items are visible through the walls where they shouldn't be, and shadows give some weird effects in some maps.

What should happen?

None of the above.

Include a GE frame capture

DUMP.zip

What are you using?

What hardware / device and operating system?

Intel i5-4200M 2.5 GHz
Windows 10

What graphics card (GPU) or mobile phone model?

Intel HD Graphics 4600

What PPSSPP version (standalone/official), and did it work before?

1.11.3
Same as in 1.9 (playable, but glitchy)

Which game or games?

ULES00719 - Asphalt Urban GT 2

Graphics backend (Vulkan, OpenGL, etc.)?

DirectX11 at 1x resolution (frameskip set to auto)

Checklist

  • Test in the latest git build in case it's already fixed.
  • Search for other reports of the same issue.
  • Try resetting settings or older versions and include if the issue is related.
  • Try changing graphics settings to determine if one causes the bug.
  • Include logs or screenshots of issue.
@hrydgard
Copy link
Owner

The little triangular glitches are almost certainly an instance of the "Range culling" problem, where we don't yet understand perfectly why triangles that reach outside the clipping box should not get culled in some situations.

I'll try the usual workaround shortly.

@hrydgard hrydgard added the Guardband / Range Culling Involves vertices outside fustrum. label Mar 16, 2021
@hrydgard hrydgard added this to the v1.12.0 milestone Mar 16, 2021
@SecularSteve
Copy link
Author

SecularSteve commented Mar 16, 2021

Thanks for responding immediately.
I myself own a still working soft-modded PSP-1008 (with a broken analogue unfortunately, had it for 9 years).
So really, I can confirm which things should and shouldn't be there.

I just have a couple of questions (if you don't mind answering):
-Is PPSSPP 2.0 going to have that tiny little video preview you get in the thumbnails on the normal PSP?
-Is it also going to have the option to run a BIOS (because I want this to be included, or at least a replica variation of it):
https://www.youtube.com/watch?v=ulb6Ic4517g

@hrydgard
Copy link
Owner

The latest build from https://buildbot.orphis.net/ppsspp/ should have the workaround now, please test.

The little video previews I've been meaning to do for a long time, there's just always been more important things to do. At least the sound is there if you hold-press or rightclick a game (or keyboard navigate to it).

As for the XMB, this question has been answered many times - PPSSPP's main focus is playing the games, and getting the XMB to work is a lot of extra work that is not likely to be useful for running games. So, it's not gonna be prioritized, similarly to the video clips...

@SecularSteve
Copy link
Author

SecularSteve commented Mar 17, 2021

Well, now it mostly looks as it should (but the literal glow of the items can still be seen through objects).

ULES00719_00004
ULES00719_00005

Maybe it's a "render distance set to high" thing or something. Because I notice that the glows render only if you're close by on the PSP (then again, you can see the headlight through the rider in the above photos).

What I'm really curious about is what kind of disadvantages the workaround's responsible for?

@hrydgard
Copy link
Owner

Oh, yeah the glow-shining-through issue is not fixed and a separate bug, but at least the very distracting triangular glitches are gone, so that's a plus for playability.

There aren't really any disadvantages. Here's the problem: Triangles that have one corner far outside the screen are discarded by the PSP in some circumstances. Some games rely on that, like the DTM Race Driver series - without this behavior, the screen is full of glitches.

Unfortunately there seems to be many factors that affect whether triangles are discarded or not, the PSP has some kind of clipping that we don't really know how it works that can reduce the size of these triangles. Our logic for this is not perfect and thus some games will get triangles discarded that shouldn't be.

So for now, the games affected by that we add to a list, and disable discarding triangles in them. Usually there are no negative effects.

@hrydgard hrydgard changed the title Asphalt 2 still has buggy textures and lightning effects in 1.11 Asphalt 2: Glowing things draw through roads and walls (also range culling, worked around) Mar 17, 2021
@hrydgard hrydgard modified the milestones: v1.12.0, Future-Prio Aug 29, 2021
@unknownbrackets
Copy link
Collaborator

Unfortunately, the frame dump here is corrupt. It would be very helpful if you could upload a GE frame dump where the issue is showing (please make sure frameskip is disabled while making the frame dump.)

If possible, use v1.11.3 to reproduce and capture the frame dump:
https://github.com/hrydgard/ppsspp/wiki/How-to-create-a-frame-dump

If you're already using a newer version, you can temporarily disable the workaround by creating a file "compat.ini" inside PSP -> SYSTEM, next to "ppsspp.ini". Inside it, paste:

[DisableRangeCulling]
ULES00719 = false

It'd be helpful to capture BOTH issues, either as separate dumps or a single dump that shows both. A frame dump is like a screenshot, it only captures the things visible on the screen at the time. You can open the frame dump with PPSSPP after creating it to double check whether it shows the issue.

I'd like to remove the workaround as I think we've discovered the real fix for this, but I'm asking for the frame dump as it would help me confirm that this fix would remove the need for the workaround. Noting #14168 / #12058 here for reference, which I expect talk about the underlying issue.

-[Unknown]

@Panderner
Copy link
Contributor

I tried to create GE dump for Asphalt Urban GT 2 unfortunately the frame dump is corrupted and only creates black screen image and the file size is 2KB.

@ghost
Copy link

ghost commented Sep 8, 2021

This game is lag on selection :(
Screenshot_2021-09-08-13-04-11-777_org ppsspp ppsspp
Screenshot_2021-09-08-13-05-23-373_org ppsspp ppsspp
selection.ppdmp.zip

@ghost
Copy link

ghost commented Sep 8, 2021

This is not related to #11013?

@Panderner
Copy link
Contributor

This game is lag on selection :(
Screenshot_2021-09-08-13-04-11-777_org ppsspp ppsspp
Screenshot_2021-09-08-13-05-23-373_org ppsspp ppsspp
selection.ppdmp.zip

Works fine in these sections:
Screenshot_2021-09-08-13-17-07-812_org ppsspp ppsspp
Screenshot_2021-09-08-13-17-13-516_org ppsspp ppsspp

@ghost
Copy link

ghost commented Sep 8, 2021

Panderner because your android version is not 11 🤔

@Panderner
Copy link
Contributor

Panderner because your android version is not 11 🤔

@Gamemulatorer Have you lowered the resolution to 1x and tried an older version of PPSSPP? Maybe it's not related to Scoped Storage.

@ghost
Copy link

ghost commented Sep 9, 2021

Panderner because your android version is not 11 🤔

@Gamemulatorer Have you lowered the resolution to 1x and tried an older version of PPSSPP? Maybe it's not related to Scoped Storage.

It's ok now after updating my ppsspp to latest git 🤔
Screenshot_2021-09-10-01-24-17-234_org ppsspp ppsspp

@ghost
Copy link

ghost commented Oct 20, 2021

GE dump can't work properly on this game 🤔
asphalt 2.zip

Remaining issue here is the light, right? depth/Z?
Screenshot_2021-10-20-22-20-59-536_org ppsspp ppsspp

@hrydgard hrydgard mentioned this issue Jul 17, 2022
5 tasks
@ghost
Copy link

ghost commented Jul 17, 2022

I have a feeling that this game uses the same engine as Street Riders...
So its basically the same as #14746

@hrydgard
Copy link
Owner

hrydgard commented Jul 17, 2022

This is a case where two framebuffers share the same depth buffer, but the blit from one to the other doesn't happen since we only do that blit when switching directly between two framebuffers with the same depth buffer (we don't directly share depth buffers because stencil is merged with depth on PC but not on PSP).

	if (prevVfb && !isClearingDepth) {
		BlitFramebufferDepth(prevVfb, vfb);
	}

It draws the arrows to a different framebuffer but expects testing against the main depth buffer, but does some other stuff in between the two passes (rendering an environment map that curiously entirely fails a depth test).

Quite fixable, but a risky fix with some potential additional overhead in games that don't actually need it. Maybe yet another
compat flag...

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Jul 17, 2022

I definitely did the direct depth switching thing to be most cautious and thinking about perf. I don't remember there being any game compat reason for it.

My suspicion is that copying depth from A -> C when B is rendered in between would be pretty safe from a regression perspective (though, you never know) but would just have perf risk. However, if any backend copies stencil while copying depth, that's a different story.

Feasibly, we could untether it from the actual switch event. The most optimal thing MIGHT be to copy the depth prior to the first flush (if any) that reads or writes depth, from the most recent vfb with a matching z_address where a write (or copy) happened. That might actually skip copies in some games.

-[Unknown]

@hrydgard
Copy link
Owner

Yes, only doing the copy once depth is accessed would probably be the best indeed. Though, a little more involved, so feel like we can start with #15700 (or at least after 1.13) .

@ghost
Copy link

ghost commented Aug 1, 2022

@Panderner can you test this game again?

@Panderner
Copy link
Contributor

Glowing through walls are gone
Screenshot (9)

@hrydgard hrydgard closed this as completed Aug 1, 2022
@hrydgard hrydgard modified the milestones: Future-Prio, v1.14.0 Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Guardband / Range Culling Involves vertices outside fustrum.
Projects
None yet
Development

No branches or pull requests

4 participants