hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
10.87k stars 2.13k forks source link

Split second lens flare visible through walls #15785

Open 71knight opened 1 year ago

71knight commented 1 year ago

Game or games this happens in

Split / second

What area of the game

Port bridge racetrack.

What happens

When driving under the building, the sun is visible through the roof.

splitsecond

What should happen

The sun shouldn't be visible through the roof.

GE frame capture

No response

Platform

Android 11

Mobile phone model or graphics card

OnePlus 7t with adreno 640.

PPSSPP version affected

Ver 1.13.1-130

Last working version

Software renderer works correctly!

Graphics backend (3D API)

Vulkan

Checklist

ghost commented 1 year ago

I can also reproduce this on my redmi note 9 mali gpu using ppsspp v1.13.1-153

Panderner commented 1 year ago

@Gamemulatorer that correct background is not right

This how it looks like on PS3: Screenshot (12)

Panderner commented 1 year ago

How about on real psp?

The HD version does not work for real PSP consoles Only works for PS3 and This emulator. Real PSP only works for Vanilla version of this game.

Panderner commented 1 year ago

Screenshot (13) Here's a screenshot for vanilla MHP3rd using software renderer

hrydgard commented 1 year ago

Wasn't this issue about Split/Second? If MHP3rd has issues, make a new issue and move the images please :)

ghost commented 1 year ago

ppsspp v1.13.1-216 Screenshot_2022-08-07-17-20-45-291_org ppsspp ppsspp ULUS10513.ppdmp.zip

ghost commented 1 year ago

Screenshot (13) Here's a screenshot for vanilla MHP3rd using software renderer

It's ok now Panderner 👍 Screenshot_2022-08-07-21-13-19-762_org ppsspp ppsspp Thanks for reply/feedback!

unknownbrackets commented 1 year ago

ppsspp v1.13.1-216 Screenshot_2022-08-07-17-20-45-291_org ppsspp ppsspp ULUS10513.ppdmp.zip

For me, software and Vulkan look somewhat similar, like this: Sun visible through building

I'm not sure if that's correct, but it's the same for both. If you take a frame dump while using software rendering, does it not happen (using that dump) even in hardware? That would be interesting.

-[Unknown]

71knight commented 1 year ago

I believe this problem is solved by using hardware readbacks, at least in aethersx2 emulator it is. When I disable hardware readbacks in aethersx2, the sun shines through every solid object. When I enable hardware readbacks, the sun is occluded by solid objects passing in front of it. I guess PPSSPP doesn't have that feature implemented yet?

ghost commented 1 year ago

This issue already exist since v1.13.0 Screenshot_2022-08-08-19-22-41-210_org ppsspp ppssppgold PPSSPP GOLD v1.13.1 (bought on playstore)

hrydgard commented 1 year ago

Yeah, I haven't confirmed exactly how the game determines whether the sun should be visible or not, but the most likely is that it's using the CPU to read the depth or color buffer. This will work in the software renderer, but not in the hardware renderer without forcing on some kind of readbacks.

Some detailed investigation is needed, and it's for sure not a new issue.

ghost commented 1 year ago

Oh.. I discover that [bluetoalpha] is the cause of this issue 🤔

[BlueToAlpha] ULUS10513 = False Screenshot_2022-08-08-22-52-04-732_org ppsspp ppsspp

hrydgard commented 1 year ago

Unfortunately that'll break the HUD :/

Does the sun effect work at all without it?

71knight commented 1 year ago

I just wanted to add an observation that I made. When the sun is at normal brightness intensity, it doesn't shine through solid objects. But when the sun increases its intensity and cast a lens flare, then the sun will shine through solid objects such as a building or roof. Also strangely, when you move the camera left or right to put the sun out of the scene and then back into the scene, sometimes the effect works correctly all of a sudden. Best seen on the docks stage just past the big carnival cruise boat that's stationary. Hopefully this information will help. Thank you for all the hard work the team put into this awesome emulator.

ghost commented 1 year ago

Unfortunately that'll break the HUD :/

Yeah forget to say that 😅

Does the sun effect work at all without it?

No, need BlueToAlpha enable to make the sun flares effect to work. Maybe this issue is related to this now https://github.com/hrydgard/ppsspp/issues/11100

ghost commented 1 year ago

ppsspp v1.13.1-216 Screenshot_2022-08-07-17-20-45-291_org ppsspp ppsspp ULUS10513.ppdmp.zip

For me, software and Vulkan look somewhat similar, like this: Sun visible through building

I'm not sure if that's correct, but it's the same for both. If you take a frame dump while using software rendering, does it not happen (using that dump) even in hardware? That would be interesting.

-[Unknown]

Loading the ge dump both hardware and software this issue can still reproduce. But loading the game normally and use software rendering the graphics is correct. Screenshot_2022-08-09-00-55-44-056_org ppsspp ppsspp

Opengl show some graphics warning that I experience recently on my android 5 phone. Screenshot_2022-08-09-00-56-13-448_org ppsspp ppsspp

hrydgard commented 1 year ago

I'm gonna fix that shader compilation error, thanks!

So yeah, bluetoalpha fixed so that the sun flare is visible, but it does not resolve the issue that it's shining through. I wouldn't say then that bluetoalpha "broke" it, rather that there is an additional separate issue to fix.

Multiple games have problems with occluded lens flares, they're usually done by some hacky readback tricks since there's no good "official" way to do them on the PSP. Sometime in the near future I'm gonna go through these and see what the games are actually doing (I only know for sure what Burnout Dominator is doing, I have a suspicion about Wipeout), and what we can do to make it work without slowing things down too much.

ghost commented 1 year ago

I also notice that minimizing ppsspp had this weird issue on Split/Second.

Suns Flares Disable (Disable Slower Effects ON)

https://user-images.githubusercontent.com/37603562/183535045-3c465319-9d5b-48e6-ab6f-ac2e56c1cea2.mp4

Sun Flares Enable

https://user-images.githubusercontent.com/37603562/183535087-7ee9c6f3-c9b3-42bc-bb9f-a3143ff76d4a.mp4

hrydgard commented 1 year ago

That is a bit weird that an old screenshot shows up, but doesn't seem to hinder playability luckily.