Black Frame Insertion possible via shader?

  • Posts: 3
2 years 2 months ago #1 by fluffymadness
Hi guys. I'm very interested in blur reduction for games that are fps locked to 60, especially for shmups.
One method of doing this is black frame insertion. Emulators like retroarch and groovymame already support this.
But it would be interesting if I could get it to work with pc games too.
The technique works this way:
1st frame
2nd frame: complete black picture
3rd frame
4th frame: complete black picture.
My understanding is when I have a display that is set to 120hz refresh rate and a pc game that is locked to 60fps...I think it should render each frame twice.
Would it somehow be possible to write a shader that colors every doubled frame completely black ?
This way motion blur should be cut in half.( I think it should correspond to the 8ms entry on the motion blur chart of blurbusters www.blurbusters.com/persistence-vs-motion-blur/ )
And yes 50% of display brightness would be gone in an instant ;)
So do you think something like that would that be possible ?
The following user(s) said Thank You: andrew, avrion

Please Log in or Create an account to join the conversation.

  • Posts: 2
2 years 1 month ago #2 by avrion
I'd be interested in this as well.

Please Log in or Create an account to join the conversation.

  • Posts: 161
2 years 1 month ago #3 by Fu-Bama
I tested it out some time ago. First the game must be v-synced, otherwise there is significant black bars screen tearing. Second, game must run at monitor refresh rate, as ReShade is synced with application FPS, not actual monitor FPS. So in order for this to work, your game must run at 120FPS with V-Sync ON.

But there's another way for black frame insertion, if your monitor supports stereo-3D, you can make it, so that "left eye" sees game graphics and "right eye" black screen. This way without 3D glasses you will have black frame flip-flop.
The following user(s) said Thank You: fluffymadness

Please Log in or Create an account to join the conversation.

  • Posts: 3
2 years 1 month ago - 2 years 1 month ago #4 by fluffymadness
@Fu-Bama, do you still have that black frame insertion shader somewhere ? I'd love to try some games with it.
Sadly I have no stereo 3d monitor, or a monitor with ulmb.
It seems there is no real way to do black frame insertion with 60fps content.
Only readup I've found on software based bfi via shaders is on the blurbusters forum, but no real solution for 60fps content was found in that discussion either.
forums.blurbusters.com/viewtopic.php?t=3223

Please Log in or Create an account to join the conversation.

  • Posts: 817
2 years 1 month ago #5 by BlueSkyKnight
This is apart of the code I used for Frame Sequential. It can do Black Frame Insertion. You need a serious type of Vsync. 120hz minimal for BFI. I also added a few other types of Frame Alternation. For testing with 60Hz monitors. But, I doubt it would work. Also if you have epilepsy or prone to attacks DO NOT USE THIS SHADER. I mean it.

Warning: This shader should not be used by people with epilepsy.

github.com/BlueSkyDefender/Depth3D/blob/...Frame_Alternation.fx

Warning: This shader should not be used by people with epilepsy.
The following user(s) said Thank You: fluffymadness

Please Log in or Create an account to join the conversation.

  • Posts: 3
2 years 1 month ago #6 by fluffymadness
Thx for your shader. The 120hz bfi shader works really great. Tested it with assault android cactus and nex machina.
I also tested the alternating patterns in the shader for games that are locked to 60fps, but as you have guessed, there isn't really any noticable blur reduction with that modes.

Please Log in or Create an account to join the conversation.

  • Posts: 1
2 years 3 weeks ago - 2 years 3 weeks ago #7 by okaxihd
Thank you very much for the codes ;) , but I wanted to know if you have any way to make frames like 30fps, 45fps, etc. at 144hz, because I tested here and it gets too flashy and in frames below 120fps a lot too high for today's top games! :blink:
Thank you again! and sorry my english ;)

Please Log in or Create an account to join the conversation.

  • Posts: 53
1 year 3 months ago #8 by FriskyNoodle
Warning: Spoiler! [ Click to expand ]


Hey can you reupload? I would absolutely love this!

Please Log in or Create an account to join the conversation.

  • Posts: 1
8 months 2 weeks ago #9 by Poudingue

Please Log in or Create an account to join the conversation.

  • Posts: 2
8 months 1 week ago - 8 months 1 week ago #10 by sp82
I have some crasy idea guys and I am here to make you fill seek.

Is it possible to insert black frames without sending them on the screen? and also apply a depth/stencil mask to make this black frame computationally zero basically. This cold be used to kill some 3d engines internal lag duo frame queuing for example that show much increased input latency with vsync-on like CSS for example.

Case One: In the case of games can render much more fps much then the monitor refresh rate.
Sequence: BlackFrame+BlackFrame+BlackFrame+RealFrame.
Explanation: the number of black frame variable depending the Frame Time to move the RealFrame at the end of the rendering time window to even more lag reduction.

Case Two: In the case of games that can render at fps just above monitor refresh rate.
Sequence: RealFrame+BlackFrame+BlackFrame+BlackFrame.
Explanation: in this case we want to render the RealFrame as soon as possible to not miss the vsync but we can insert BlackFrames at the end.

This can work if the engine as no internal frame pacing in other case will be a mess.

I am curious if is possible to implement a fps cap shader that do also frame pacing to use with vsync-on with adaptive sync just below the max refresh rate of the monitor. This could give much more smooth gameplay for some games. I need to cap the fps just 2 fps below the max refresh rate because my monitor is one of the bad freesync monitors that have brightness flicker.

Please Log in or Create an account to join the conversation.