Emulator Issues #5999
Zelda Games Lens Flare depth emulation Issues on D3D11
The Legends of Zelda: Twilight Princess (GC) - GZ2E01
While in recent revisions, the lens flare works in D3D9 and OpenGL without issues (previously, I remember it sometimes not working after so long) I noticed an issue when testing D3D11 that made me want to check out the game in more depth. Apparently, for some reason you can trigger the lens flare and darkening of the screen by looking at the sun, no matter where it is. Where as in the other back-ends it works fine.
To reproduce the problem, simply start a new game, and when you take control of link, walk through the south exit of the map. The guy will yell at you and force you to come back a bit. Then, C-up and go into first person and turn to your left (so you're facing the left of the map) and look at the big tree. On OpenGL and D3D9, you'll just see a tree. But in D3D11, depending on your angle a varying amount of the lens flare will kick in. This effect can be very distracting at sunrise and sundown when the sun is hidden behind objects.
I used 3.5-392 and 3.5-395(1c64b1993de02405e563c5fa13d5b4cb7818c520) for a majority of my testing, both 32bit and 64bit (for some reason I thought OpenGL was broken in 64bit, but ended up just having a setting wrong.)
As a work around, you can turn off the effect (presumably with more side-effects though...) by turning on skip efb access from CPU temporarily if the effect is causing visibility issues. Through thorough testing, the problem seems to go back all the way past version 3.0.
My CPU is core i5 760 @ 3.8 GHz with a GTX 470. Was confirmed on another computer over IRC, though, and on a Radeon card, so it's not a driver issue.
Now, one last thing, on Software rendering everything works fine except the screen seems to be distorted with black bars. Originally I thought that the effect wasn't rendering in software mode, but it turns out that it just takes a couple frames to draw, which is a long time in software rendering!
Any other relevant information or links to logs:
Darkness Effect in D3D11 - http://i.imgur.com/wCohQ2N.png
Confirmed on 2nd Computer by big tree - http://i.imgur.com/5TxIZZN.png
Looking in the same spot in OpenGL - http://i.imgur.com/Gk4jzX6.jpg
Black Bars in Software Rendering - http://i.imgur.com/LQxo3jE.png
I do have fifo logs of each area, but, I find that using them simply doesn't work. Sometimes, even though the effect works in game, it won't show up in the log, or, in DX11's case, it'll work properly if you load from a fifo log. I'm pretty sure using the fifo logs at first confused me and made making this issue a lot harder to pinpoint.
#5 Updated by Armada over 8 years ago
It seems the flare bug is also visible in DX9, but it quickly hides itself after a few frames - http://i.imgur.com/39U8VCP.png
Here are two fifo logs one for each renderer of the exact same 5 frames loaded from a save state: http://www.mediafire.com/?n7w7l4h3ya21n8w
You can see that in the DX9 renderer the flare quickly fades while in the DX11 renderer the flare stays.
#8 Updated by JMC4789 almost 8 years ago
- Status changed from Accepted to Fixed
This is currently fixed in Master. I do not know exactly when it was fixed. Maybe by a D3D update even?
Either way, I've been testing this for a while and I can no longer cause it to happen. I wish I understood why it stopped happening though.
#14 Updated by Autoran1 over 7 years ago
Tested this issue, the thing was broken long time ago in r6751 of SVN- rd435fd89
just reverted PixelShaderCache.cpp code in DX11, and everything seems to work fine even with recent code
Here's the right position of the sun on recent build
But since revert it not right, i'm expecting correct bugfix
#21 Updated by Autoran1 over 7 years ago
Yup ZWW is absolutely here, and suffers from this too, how can i reproduce Luigi mansion issue
Besides i think there are still few old D3D11 issues on this tracker which could be fixed by this, well except Silent Hill Shattered Memories, i tried this one, unfortunately there is smth else
#24 Updated by JMC4789 over 7 years ago
- Status changed from Accepted to Fixed
Fixed by 4.0-1487 - https://dolphin-emu.org/download/dev/a40ea4e26ace3a56c6bcc2f4dc2b075a3ecf0ae0/