Closed TrentWeiss closed 3 years ago
Ill take a look at it. I think its due to the difference in the framesize/pixel format.
I could not reproduce black images. I tried full screen star craft and was able to capture normally. Can you do a little debugging and see where the problem is? It shouldnt be that bad, this file is where all of the work is done https://github.com/smasherprog/screen_capture_lite/blob/master/src/windows/DXFrameProcessor.cpp
Theres an example file in this repo where you can capture and write the images to disk. Id start there as this is an easy way to test.
I guess star craft isnt DX12. So, i am installing WOW to test out DX12
I have been testing on F1 2019 http://www.formula1game.com/.
it has the option to run as either DirectX12 or DirectX11.
On DirectX11, everything works as expected.
On DirectX12, images are just black (except for the title bar, interestingly enough.).
Looks like DXFrameProcessor explicitly uses the DirectX11 SDK. Could that be the underlying issue?
Yeah its very likely thats the case. I was going to look into this yesterday but got sidetracked. Ill for sure look at it now though.
Awesome. I am not a skilled WIN32 programmer and I am certainly not a DirectX programmer, but it looks like Microsoft has a mechanism to ease the interchangeability of the two APIs. https://docs.microsoft.com/en-us/windows/win32/direct3d12/direct3d-11-on-12
I cant reproduce what you are experiencing. I am running WOW using DX12. Attached is a screenshot taken using the example code here https://github.com/smasherprog/screen_capture_lite/blob/master/Example/Screen_Capture_Example.cpp
I was also able to capture windows as well without issue. Try using the example code to capture and save the images to disk to see if it works.
It could be that application you listed above is doing something it shouldn't be? Can you try a print screen and see if you are able to see the game using that method? If that doesnt work then there is something really strange going on with that app.
Confirmed, exact same result when using the example code: Results with DirectX11
Exact same test procedure with DirectX12
Note the difference in the title bar (which is captured correctly in both cases)
A manual PrtScr is able to capture the game just fine, even on DirectX12.
Strange.. I dont know whats going on. Im going to try some other dx 12 examples/games and see if I can reproduce this. Thanks for your efforts on this.
No problem. You're the real MVP for making this library. It saved me a TON of effort on my project. I'll keep playing around with the game's settings to see if I can get it to work. In the meantime, the DirectX11 version works wells enough.
stumbled across these when googling around for solutions: https://github.com/microsoft/DirectXTK https://github.com/Microsoft/DirectXTK12
It looks like Microsoft is finally acknowledging how terrible the interface for the DirectX APIs is and is making (slightly) convenient wrappers.
I've been trying dx 12 apps and even created a new dx12 project to try and create a bare-bones app to produce this and I cannot. Ill leave this issue open as I don't know why this specific application isn't capture-able in dx 12 mode.
I have a feeling the issue is one of the following:
Since the core implementation of screen_capture_lite assumes 8-bit BGRA images, supporting either of those things will require a fairly major overhaul. If DirectX12 compatibility becomes an absolute necessity, I may take it upon myself to propose a new architecture for such a change. But, for now anyways, I'll just keep the game running in DirectX11.
Thanks so much for looking into this!!!
https://github.com/smasherprog/screen_capture_lite/pull/89 should have fixed this now
I have noticed that capturing applications running DirectX12 on Windows 10 produces nothing but black images (regardless of what is happening in the application). Any idea what would cause this behavior?