pcsx2
pcsx2 copied to clipboard
[BUG] Sun flares shine through walls in hardware renderer.
Bug Description In hardware renderer the sun flares shine through walls. Tested in Need for Speed Most Wanted.
To Reproduce Play the game and make sure the sun is in front of you. Then you drive under a bridge. You'll see that the sun is hidden in sofware renderer mode, but still visible in hardware mode.
Expected behavior The sun should be behind the objects. As in the software renderer.
Settings I tried all possible settings in the GS plugin. Including hacks. It occurs in the default settings. It only disappears when switching to software mode. This means, it does not matter if using OpenGL or Direct3D. I just enabled the Half-pixel Offset to Normal (Vertex) to remove lines around the textures. But this has no effect to this issue. Let me know if you would like any specific settings. However, I'm sure there is only software / hardware settings to work around this issue. No special settings here.
Maybe you can explain the reason for this issue. That would be interesting. Hopefully we can find a solution.
Using the Skipdraw Range hack should not be a solution. At that moment I found no value for it.
Maybe we can reorder the layers. But maybe it's another issue. Not about the layers. Because when the sun is at the edge of the bridge, it is not only covered by the wall. It's a transition. Maybe a missing feature. Like raycast. See:
(Software Renderer. This is what is expected in hardware mode. But in HW mode, the sun is not covered.)
GS Window Screenshots
| Actual (HW) | Expected for HW (SW) |
|---|---|
![]() |
![]() |
videos-webm (Videos with more frames. GitHub does not yet support videos (no audio) ... Use e.g. VLC to view it. Or just the browser by drag'n'drop.)
System Info
- PCSX2 Revision: v1.7.0-dev-675-g85c3ee823
- OS: Windows 10 Pro 64-bit (v2004)
- CPU: AMD Ryzen 5 3600 (6/12 Cores)
- GPU: Nvidia GeForce RTX 2070 Super
- RAM: 32GB
- SSD: Yes
Can you provide a gs dump?
Here is the GS dump: gsdump-frame-nfsmw-bug-sun-flare.zip Let me know if you need more stuff.
This game renders into the clut to update the alpha channel of the sun texture to decide if it's visible or not.
Could the SwSpriteRenderer be of any help here?
It's complicated. Clut is drawn sampling and rendering into a previous RT then copied.
So you need data from GPU.
Nice. Btw the function already reads back from gpu memory by default. Obv, the data should be there and not cluttered in TC garbage.
Tested in latest (nightly) version 1.7.3137. This bug still exists.
Yup, not quite sure at the moment what this game does to occlude light. This bug appears in many games, but they all do it differently.

