-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Sun lens flare in Wipeout Pure flickers since #13327 #13344
Comments
Confirmed that on the real PSP, the lens flare effect is turned off when the sun is behind something. In PPSSPP now though, it seems entirely random. |
The minimal change that restores the previous, also wrong but more tolerable, behavior, is: Line 473 in SoftwareTransformCommon.cpp:
Given how the PSP's masks work, the original code (before the "culprit" change) is quite obviously wrong indeed. Question is what to do about this - will depend on how the game is actually accomplishing the lens flare effect, which I haven't looked into much yet. |
I still haven't looked at this properly, but is the flicker ONLY when the sun shouldn't show at all, or does it now flicker at all times? Perhaps it just indicates that we're only detecting one clear out of two frames, causing the flicker. -[Unknown] |
It feels like it's trying to somehow read the depth buffer or similar at the sun position to find out when the lens flare should be drawn, but it's reading from a texture full of garbage. It's not every second frame or anything like that - if the camera is still, it doesn't flicker. |
Experimenting a bit with the change, it's clear that it's actually reading the color buffer using the CPU to figure out whether to draw the lens flare or not. Probably checking alpha/stencil. So if we read back the color buffer every frame into PSP VRAM, the lens flare would be correct. If we simply turn off the first-frame readback of color buffers (which that safesize thing is about), we get back the old behavior which is that it reads from a buffer of zeroes and apparently always shows the lensflare, which look much better than the flickering. So I'm thinking about just doing a compat.ini setting, it's not worth inflicting a full frame color readback every frame just for the lens flare, even if it would be accurate, until I can implement the Vulkan-only async readbacks I've been planning for some time... |
See #13344. Will try to figure out something better after the next release...
Did #13941 improve this issue? Might have to remove from compat.ini to confirm. -[Unknown] |
Sun lens flare still flickering, DisableFirstFrameReadback doesn't help. |
This will be worked on as part of #15923 . Here's the disassembly of the function that reads a 4x4 pattern from the depth buffer:
|
This is solved now since #19759 with depth buffer software rasterization, although at a performance cost. This cost will be minimized before the next release. |
This is happening since #13327, more specifically 5ade93a.
The previous behavior of the sun always being visible is almost certainly wrong, but so is this flicker. We might have to get to the bottom of this. I don't know if it's doing depth texturing, or trying to read the depth map with the CPU, or what.
Quick video clip:
wipeoutflicker.zip
The text was updated successfully, but these errors were encountered: