Page 3 of 3

Re: Using a reshade black frame insertion shader fx?

PostPosted: 24 Aug 2019, 10:06
by deama
Kheri wrote:Well, I haven't much luck with the program yet -- it just flickers like mad.

I did something like this to get it working on the primary display:
https://docs.microsoft.com/en-us/window ... terfromhdc
Code: Select all
   DISPLAY_DEVICE dd;
   memset(&dd, 0, sizeof(dd));
   dd.cb = sizeof dd;
   int i;
   for (i = 0; EnumDisplayDevicesA(NULL, i, &dd, 0); ++i) {
      if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) {
         break;
      }
   }

   oa.hDc = CreateDC(NULL, dd.DeviceName, NULL, NULL);

What are you supposed to do with that code?

Re: Using a reshade black frame insertion shader fx?

PostPosted: 24 Aug 2019, 16:59
by Kheri
deama wrote:What are you supposed to do with that code?


That's just a code snippet I put into my own copy of the source code to get the program detecting my primary monitor; I have a multi-monitor setup. I didn't feel like putting it up on GitHub. I'm also not sure how good/appropriate of a solution it is.. I believe there are other ways to get the Device Context or Monitor ID. All of that code snippet replaces the single "oa.hDc = ..." line in the source code. (Then you would have to "Build" it into an executable, of course.) Hope that makes sense.

Edit: to be clear, the snippet is just for detecting the main monitor. I couldn't successfully run the previous executable because it was failing to do so. It doesn't prevent the monitor from flickering.

Re: Using a reshade black frame insertion shader fx?

PostPosted: 24 Aug 2019, 23:16
by deama
Kheri wrote:
deama wrote:What are you supposed to do with that code?


That's just a code snippet I put into my own copy of the source code to get the program detecting my primary monitor; I have a multi-monitor setup. I didn't feel like putting it up on GitHub. I'm also not sure how good/appropriate of a solution it is.. I believe there are other ways to get the Device Context or Monitor ID. All of that code snippet replaces the single "oa.hDc = ..." line in the source code. (Then you would have to "Build" it into an executable, of course.) Hope that makes sense.

Edit: to be clear, the snippet is just for detecting the main monitor. I couldn't successfully run the previous executable because it was failing to do so. It doesn't prevent the monitor from flickering.

Oh ok, I only got 1 monitor.

Re: Using a reshade black frame insertion shader fx?

PostPosted: 30 Aug 2019, 19:55
by fuzun
squeaksci wrote:I got it to work! It's a tiny C++ program, if you want to compile it, it uses the Windows Driver Kit for a v-sync function.
Github page: https://github.com/squeaksci/desktopbfi
Download, if you're comfortable running a program from a stranger: https://github.com/squeaksci/desktopbfi/releases
Problems are likely, I'm not a great programmer. Let me know how it goes!


I think that this project is really interesting. This was something that I wanted to do in my free time.
I have tested it and in my computer it works quite good.

If you are interested, I have integrated my small and not very well coded "strobe" library into this project.
With it, this is now much more flexible. If you have 144hz monitor, now you can try [RENDER - BLACK - BLACK] sequence instead of classic [RENDER - BLACK] as R-B causes some color problems.

I suggest Render Mode: 2 or -2 for 144hz monitor. Note that even modes have advantages because they don't require algorithms to prevent image retention.

Source Code:
https://github.com/fuzun/desktopbfi

Binary:
https://github.com/fuzun/desktopbfi/releases/tag/v1.1

Usage:
desktopBFI.exe [Strobe Mode] [Phase Switch Interval in Seconds] [Debug Mode]

if you set debug mode = 1, this will show up:
Image

Re: Using a reshade black frame insertion shader fx?

PostPosted: 01 Sep 2019, 03:11
by deama
fuzun wrote:
squeaksci wrote:I got it to work! It's a tiny C++ program, if you want to compile it, it uses the Windows Driver Kit for a v-sync function.
Github page: https://github.com/squeaksci/desktopbfi
Download, if you're comfortable running a program from a stranger: https://github.com/squeaksci/desktopbfi/releases
Problems are likely, I'm not a great programmer. Let me know how it goes!


I think that this project is really interesting. This was something that I wanted to do in my free time.
I have tested it and in my computer it works quite good.

If you are interested, I have integrated my small and not very well coded "strobe" library into this project.
With it, this is now much more flexible. If you have 144hz monitor, now you can try [RENDER - BLACK - BLACK] sequence instead of classic [RENDER - BLACK] as R-B causes some color problems.

I suggest Render Mode: 2 or -2 for 144hz monitor. Note that even modes have advantages because they don't require algorithms to prevent image retention.

Source Code:
https://github.com/fuzun/desktopbfi

Binary:
https://github.com/fuzun/desktopbfi/releases/tag/v1.1

Usage:
desktopBFI.exe [Strobe Mode] [Phase Switch Interval in Seconds] [Debug Mode]

if you set debug mode = 1, this will show up:
Image

I tried it and I still get lots of flickering, what's going on? Is it something to do with my monitor or computer?
Here's a picture of the debug, it seems like it can't really reach 144fps? I tried setting the priority of the program to high but didn't really make a difference.
Image


EDIT: Hmm, ok, maybe not, I tried again with a -2 render mode this time and the fps was higher, but there was still a bunch of flickering:
Image

Re: Using a reshade black frame insertion shader fx?

PostPosted: 04 Sep 2019, 23:19
by Chief Blur Buster
One could also temporarily switch to the Performance plan temporarily while running this BFI module.

This can also be done programmatically (using API to switch to high performance mode) via the PowerGetActiveScheme() and PowerSetActiveScheme() to force the computer to 100% GPU. At least you'd notify the user of reduced accuracy if you're on the battery-miser power plan...

This will kill battery, but can dramatically increases BFI precision.

Re: Using a reshade black frame insertion shader fx?

PostPosted: 17 Sep 2019, 17:02
by EDIIIZ
squeaksci wrote:Alright, I updated with Chief's polling suggestion, it fixed the flickering on my other computer, though I couldn't test any games on it. I hope it works! Same download link: https://github.com/squeaksci/desktopbfi/releases


Hey, just tried your programm with my already strobed display and the "motion blur" and "overdrive artifact" results are amazing. Ofcourse brightness and fluidity is trash.

I have the LG 24GL600F with a 144hz refresh.
The HW Blur reduction has alot of Strobe Crosstalk.
Your Software BFI has none but clarity isnt as good. Now when i combine Software BFI with Hardware BFI Clarity is perfect, Overdrive Artifacts are gone and Strobe Crosstalk is also gone. Can someone explain this? :D

Double Strobed (Software + Hardware + Highest Overdrive)
Image

Single Strobed (Hardware + Highest Overdrive)
Image