SilentNightSound / GI-Model-Importer

Tools and instructions for importing custom models into a certain anime game
https://discord.gg/agmg
GNU General Public License v3.0
2.66k stars 364 forks source link

Black screen when HDR is enabled #152

Open longti2233 opened 1 year ago

longti2233 commented 1 year ago

After the 4.1 update, it became possible to set the registry HKEY_CURRENT_USER\Software\miHoYo\Genshin Impact\WINDOWS_HDR_ON_xxx to 1 to enable HDR of this game (this is not Auto HDR from Windows 11, but native HDR), and it works wonderfully on its own. However, if I use GIMI 7.0 along with native HDR enabled, the game does not display anything but black screen. I can hear the audio and it appears that I can enter the game fine (I can even see the green credit info text at the bottom left of the screen), it is just that nothing of the game is drawn on screen besides total blackness. I am interested in knowing the reason behind this issue, is it possibly caused by how 3dmigoto works? Is there any possible fix to it?

An extra note: Windows 11 Auto HDR works perfectly fine with GIMI, no black-screen issue.

leotorrez commented 1 year ago

not sure how windows hdr works. you can try pressing f9 when in game. if it restores image, then is some 3dm config messing with stuff. if f9 doesnt fix anything then the conflict happens before the game even starts

ConfessedCandy commented 6 months ago

Currently having this same issue and can confirm pressing F6, F9, or F10 does nothing. F1 does at least bring up the help menu. This issue should be reopened

Kradziej commented 6 months ago

Genshin fails because 3dmigoto blocks QueryInterface upcast from IDXGISwapChain1 to IDXGISwapChain3, IDXGISwapChain3 is required to setup color space for HDR.

Simple fix is just to allow QueryInterface to return IDXGISwapChain3 interface without wrapper.

https://github.com/bo3b/3Dmigoto/blob/ea9f8ce2c2e2cb845d587f052491ca2c5d79af03/DirectX11/HackerDXGI.cpp#L367-L372

change to something like this

if (riid == __uuidof(IDXGISwapChain3))
{
        LogInfo("  return IDXGISwapChain3 interface (%p) without wrapper.\n", ppvObject);
        LogInfo("  returns result = %x for %p\n", hr, ppvObject);
        return hr;
}

I can confirm its working just fine without any wrapper on that interface. It would be really nice if you could fix it in your carefully maintained 3migoto source code so everyone can enjoy the beauty of native HDR.

Kradziej commented 6 months ago

Temp solution - bin patched working dll d3d11.zip

ConfessedCandy commented 2 months ago

@leotorrez Now that this is an issue with a non-official fix can you reopen the issue so someone can see and implement the fix?