Using a reshade black frame insertion shader fx?

Talk to software developers and aspiring geeks. Programming tips. Improve motion fluidity. Reduce input lag. Come Present() yourself!
User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: Using a reshade black frame insertion shader fx?

Post by Chief Blur Buster » 14 Feb 2022, 00:48

mdzapeer wrote:
12 Feb 2022, 12:17
I have one question though, regarding how the phase switch interval should be used?
For 180 Hz, you do not need a phase switch interval.

Odd-divisor software BFI is always 100% burn-in immune.
No image retention will occur with 60fps @ 180Hz BFI.

Necro is worth it, we need more software-BFI buzz.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

KuraiShidosha
Posts: 18
Joined: 15 Oct 2017, 13:59

Re: Using a reshade black frame insertion shader fx?

Post by KuraiShidosha » 12 Mar 2022, 04:21

I'm guessing the same doesn't apply to 144hz running 60 fps content? I am getting image retention on my AHVA "IPS" Asus monitor.

This program has been a wonderful find for me, I truly appreciate it as it's been such fun to tinker and experiment with and gives me hope for future displays. Right now, I use it on my VGA CRT for simulating 240p 60hz emulation content where my VGA CRT must be ran at 640x240 120hz in order to get a working signal out of her (I wish I could do 320x240 120hz but it's no dice) Having this software BFI at 120hz on the CRT is a godsend. It's even fun to test 30 fps content at 60hz and see the unbelievable fluidity one can have at 30 fps = 30hz. Too bad about the eye piercing flicker! :lol:

All that said, this has me seriously invigorated to get an OLED at some point in the future and allow me to finally replace my CRT as a defacto best device for motion clarity. I imagine a 120hz OLED in hardware BFI mode + software BFI should theoretically deliver an unprecedented level of motion clarity if not a dim and possibly flickery one. I really am not bothered by flicker though, and look forward to getting one in-house and giving it a go.

It's been long enough now that I would imagine some folks around here could answer. Regarding CRT shaders + BFI on OLEDs, is there any cause for concern for permanent damage? I plan to get a 4k OLED and use CRT shaders on it to simulate the slot mask in conjunction with hardware + software BFI for perfect 60hz motion clarity. I just want to make sure I wouldn't have anything to worry about using such a setup in the future, thanks!

mdzapeer
Posts: 73
Joined: 14 Feb 2014, 03:22

Re: Using a reshade black frame insertion shader fx?

Post by mdzapeer » 12 Mar 2022, 08:13

LG 4K OLED already support single strobe at 60hz as far as I am aware, I couldn't afford a 4K oled TV at the time when I bought my currently LG NANO TV but it also supports 60hz strobing and is my current go to retro gaming and 60hz locked games (Elden Ring!). No need to worry about software BFI on a LG OLED TV they already go down to 60hz, just use regular CRT shaders which look amazing on 4K.

Hopefully there are more monitors which start to support 60hz strobing in the future, and there is more development in software BFI which has the potential to be really amazing on very high refresh rate monitors giving flexibility on how the image is strobed. I can just imagine only parts of the picture being shown for 600hz+ displays to simulate a more softer fade off for a strobed image (for 60fps or lower content), while even tweaking the brightness as well, I am sure the chief is aware of many more techniques. Software BFI should also work for VRR strobing as long as the actual monitor refresh is at its max possible.

Stache
Posts: 4
Joined: 28 Sep 2022, 01:10

Re: Using a reshade black frame insertion shader fx?

Post by Stache » 28 Sep 2022, 01:18

Kheri wrote:
24 Aug 2019, 16:59
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.
Sorry for the bump. I doubt I'll get a response but asking is better than not.

I've attempted to build this program without the adjustment, and with the adjustment for multi monitor setups, but I can't seem to get it to build in visual studio without a bunch of errors showing up and not building. Will you provide the compiled build with the multi monitor adjustment, or will someone else provide one? I have a multi monitor setup and it would be very inconvenient to disable all but one of my monitors to use this program. Thank you.

User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: Using a reshade black frame insertion shader fx?

Post by Chief Blur Buster » 29 Sep 2022, 14:00

Stache wrote:
28 Sep 2022, 01:18
Kheri wrote:
24 Aug 2019, 16:59
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.
Sorry for the bump. I doubt I'll get a response but asking is better than not.

I've attempted to build this program without the adjustment, and with the adjustment for multi monitor setups, but I can't seem to get it to build in visual studio without a bunch of errors showing up and not building. Will you provide the compiled build with the multi monitor adjustment, or will someone else provide one? I have a multi monitor setup and it would be very inconvenient to disable all but one of my monitors to use this program. Thank you.
1. What Visual Studio version? It is not compatible with some versions, especially if you haven't installed SDK's necessary for some of the specialized APIs.
2. Please paste your Visual Studio errors into a [php] or [code] block.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

Stache
Posts: 4
Joined: 28 Sep 2022, 01:10

Re: Using a reshade black frame insertion shader fx?

Post by Stache » 29 Sep 2022, 18:27

Chief Blur Buster wrote:
29 Sep 2022, 14:00
1. What Visual Studio version? It is not compatible with some versions, especially if you haven't installed SDK's necessary for some of the specialized APIs.
2. Please paste your Visual Studio errors into a [php] or [code] block.
I downloaded visual studio 2022, with WDK as listed from here: https://github.com/squeaksci/desktopbfi.





Here are the errors. I didn't modify the code that supposedly worked for others.

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error (active)	E0513	a value of type "const char *" cannot be assigned to an entity of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	49	
Error (active)	E0167	argument of type "const char *" is incompatible with parameter of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	54	
Error (active)	E0167	argument of type "const char *" is incompatible with parameter of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	54	
Error (active)	E0167	argument of type "const char *" is incompatible with parameter of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	65	
Error (active)	E0167	argument of type "const char *" is incompatible with parameter of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	66	
Error (active)	E0167	argument of type "const char *" is incompatible with parameter of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	73	
Error (active)	E0167	argument of type "const char *" is incompatible with parameter of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	73	
Error (active)	E0167	argument of type "const char *" is incompatible with parameter of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	89	
Error (active)	E0167	argument of type "const char *" is incompatible with parameter of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	89	
Error (active)	E0167	argument of type "const char *" is incompatible with parameter of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	94	
Error (active)	E0167	argument of type "const char *" is incompatible with parameter of type "LPCWSTR"	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	94	
Message	lnt-uninitialized-local	Local variable is not initialized.	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	34	
Message	lnt-uninitialized-local	Local variable is not initialized.	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	84	
Message	lnt-uninitialized-local	Local variable is not initialized.	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	85	
Message	lnt-uninitialized-local	Local variable is not initialized.	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	103	
Error	C2440	'=': cannot convert from 'const char [22]' to 'LPCWSTR'	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	49	
Message		Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	49	
Error	C2664	'int MessageBoxW(HWND,LPCWSTR,LPCWSTR,UINT)': cannot convert argument 2 from 'const char [28]' to 'LPCWSTR'	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	54	
Message		Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	54	
Message		see declaration of 'MessageBoxW'	DesktopFBIMMTest	C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winuser.h	9176	
Error	C2664	'HWND CreateWindowExW(DWORD,LPCWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HMENU,HINSTANCE,LPVOID)': cannot convert argument 2 from 'const char [22]' to 'LPCWSTR'	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	63	
Message		Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	65	
Message		see declaration of 'CreateWindowExW'	DesktopFBIMMTest	C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winuser.h	4433	
Error	C2664	'int MessageBoxW(HWND,LPCWSTR,LPCWSTR,UINT)': cannot convert argument 2 from 'const char [24]' to 'LPCWSTR'	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	73	
Message		Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	73	
Message		see declaration of 'MessageBoxW'	DesktopFBIMMTest	C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winuser.h	9176	
Error	C2664	'int MessageBoxW(HWND,LPCWSTR,LPCWSTR,UINT)': cannot convert argument 2 from 'const char [65]' to 'LPCWSTR'	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	89	
Message		Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	89	
Message		see declaration of 'MessageBoxW'	DesktopFBIMMTest	C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winuser.h	9176	
Error	C2664	'int MessageBoxW(HWND,LPCWSTR,LPCWSTR,UINT)': cannot convert argument 2 from 'const char [61]' to 'LPCWSTR'	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	94	
Message		Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	94	
Message		see declaration of 'MessageBoxW'	DesktopFBIMMTest	C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winuser.h	9176	
Warning	C4244	'return': conversion from 'WPARAM' to 'int', possible loss of data	DesktopFBIMMTest	C:\Users\adria\source\repos\DesktopFBIMMTest\DesktopFBIMMTest\DesktopFBIMMTest.cpp	128	

User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: Using a reshade black frame insertion shader fx?

Post by Chief Blur Buster » 29 Sep 2022, 19:00

This is a common wrong-bitsize issue for char.

Are you compiling for x86 or x64?

LPCWSTR behaves differently depending on whether you compile for 32-bit or 64-bit, and whether char is a 8-bit or 16-bit.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

Stache
Posts: 4
Joined: 28 Sep 2022, 01:10

Re: Using a reshade black frame insertion shader fx?

Post by Stache » 29 Sep 2022, 20:35

Chief Blur Buster wrote:
29 Sep 2022, 19:00
This is a common wrong-bitsize issue for char.

Are you compiling for x86 or x64?

LPCWSTR behaves differently depending on whether you compile for 32-bit or 64-bit, and whether char is a 8-bit or 16-bit.
As far as I know, it's x64. I'm not sure how to change char bit sizes or change it to 32 bit. I would just press build solution and there's no option for either of those. Sorry. This is new to me.

User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: Using a reshade black frame insertion shader fx?

Post by Chief Blur Buster » 29 Sep 2022, 20:48

Stache wrote:
29 Sep 2022, 20:35
Chief Blur Buster wrote:
29 Sep 2022, 19:00
This is a common wrong-bitsize issue for char.

Are you compiling for x86 or x64?

LPCWSTR behaves differently depending on whether you compile for 32-bit or 64-bit, and whether char is a 8-bit or 16-bit.
As far as I know, it's x64. I'm not sure how to change char bit sizes or change it to 32 bit. I would just press build solution and there's no option for either of those. Sorry. This is new to me.
At least we've found the problem. Newbie mistake.

Option A: Settings-Change Suggestions
- Try testing a compile for x86.
- If it doesn't compile for x86 either then fiddle with Properties -> (somewhere, I think Advanced or General) -> Character set
- Try all the settings (MBCS, Unicode) with both x86 and x64 until it compiles.

And for coders who don't want to change VS settings:

Option B: Code-Change Suggestions
- Ideally the github code should have had a #pragma line to do it automatically to override the currently configured VS setting for sizeof(char).
- Or refactor the code to use char8_t, char16_t, char32_t instead of "char" or "CHAR" which can vary in bit size
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

Stache
Posts: 4
Joined: 28 Sep 2022, 01:10

Re: Using a reshade black frame insertion shader fx?

Post by Stache » 29 Sep 2022, 22:54

Chief Blur Buster wrote:
29 Sep 2022, 20:48

At least we've found the problem. Newbie mistake.

Option A: Settings-Change Suggestions
- Try testing a compile for x86.
- If it doesn't compile for x86 either then fiddle with Properties -> (somewhere, I think Advanced or General) -> Character set
- Try all the settings (MBCS, Unicode) with both x86 and x64 until it compiles.

And for coders who don't want to change VS settings:

Option B: Code-Change Suggestions
- Ideally the github code should have had a #pragma line to do it automatically to override the currently configured VS setting for sizeof(char).
- Or refactor the code to use char8_t, char16_t, char32_t instead of "char" or "CHAR" which can vary in bit size
Thank you for your responses and advice. Swapping around the character set did remove a lot of the errors but I was stuck with one more. I had to change the subsystem from Console to Windows in Project properties>Linker>System. I can provide a compiled version of funzun's fork with the multi monitor fix if you're okay with that.

Post Reply