libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.25k stars 1.83k forks source link

In Direct3D modes, fade animation at startup is backwards (fades to black instead of from black) #9054

Open Dwedit opened 5 years ago

Dwedit commented 5 years ago

When using either Direct3D 9, 10, 11, or 12, the fade that happens at startup plays backwards, fading to black instead of from black, leaving you with a black screen for a few seconds.

Any help here? I don't know which code to look for, can't find anything on a search for Fade or Black.

Dwedit commented 5 years ago

I can confirm that the problem does not happen in Windowed mode, but does happen in fullscreen mode. I added in a Sleep command to watch it happen in slow motion, and sure enough, it is fading to black, and not just the screen blanking due to changing video modes.

How exactly does the fade effect work? So far all I can see is an alpha member of xmb changing frame by frame...

Perhaps there's a bug in the D3D shaders used for the XMB menu, and it's inverting alpha somewhere?

inactive123 commented 5 years ago

Hi there.

Unfortunately, I'd have to ask @kivutar for answering this, as I don't know myself. I too could use that fade to black effect somewhere else and I wish it was easier to use.

kivutar commented 5 years ago

If it only happen on DX, it has little to do with the menu and tweening logic. Somebody would have to inspect the values sent to gfx/drivers/ during the animation and see why it is inverted.

Also, if it is a regression, we can check the recent changes to the DX draw code.

Dwedit commented 5 years ago

The logic for the animation itself is dead simple, it just changes the alpha color values at the vertices.

The D3D alpha blending mode could be set incorrectly or something, or the shader might be interpreting the numbers wrong.

Doubt it's a regression, I've never seen it work correctly once. It is easy to mistake for a flicker of graphics, then your screen staying blanked during a video mode change, so people might not have realized it was a fade playing backwards.

LibretroAdmin commented 2 years ago

@Dwedit Is this still an issue? The blending code is in the gfx/display_driver implementation if memory serves me correctly.