Skip to content

Conversation

@mausimus
Copy link
Owner

@mausimus mausimus commented Aug 10, 2025

This is an early experimental version of ShaderGlass adding BFI & Blur Busters CRT Beam Simulator shaders.

Please refer to the alpha release here:
#202

@mausimus mausimus self-assigned this Aug 10, 2025
@mdrejhon
Copy link

I have not tested this -- but, question -- does this work with framerates different from the simulated target Hz?

That is kind of the original CRT behavior preservation (e.g. like running low frame rates on a CRT). Where low framerates keeps merrily working fine (just stutters and/or creates double image artifacts ala 30fps at CRT 60Hz double-image effect).

Say hi to me on Discord @blurbusters if you'd like;

@mausimus
Copy link
Owner Author

Thank you for your comment, I sent you a message on Discord!

Technically yes, processing is completely detached from input framerate (for better or worse - exact timing and sync not guaranteed...) so it will work with lower input frame rates, too. The fight with this approach is ensuring we can get frames from Windows Capture timely (without having to introduce buffering and latency) and that DWM consistently renders a high frame-rate unfocused window, on top of a focused input window - the aim of ShaderGlass is to provide real-time effects over gaming/interactive content.

While in some scenarios there's been success, there's still a lot of work (research and experimentation really, since this isn't an approach Windows really caters to) necessary to make timing as consistent as possible.

@mdrejhon
Copy link

mdrejhon commented Aug 17, 2025

Thank you for your comment, I sent you a message on Discord!

Technically yes, processing is completely detached from input framerate (for better or worse - exact timing and sync not guaranteed...) so it will work with lower input frame rates, too. The fight with this approach is ensuring we can get frames from Windows Capture timely (without having to introduce buffering and latency) and that DWM consistently renders a high frame-rate unfocused window, on top of a focused input window - the aim of ShaderGlass is to provide real-time effects over gaming/interactive content.

Thanks, I replied on Discord!

Some suggestions:

  1. An adjustable tape delay (in microsecond increments), like an ultra tiny Netflix buffer between input and output frames. Not frame-granularity; but microsecond granularity; and

  2. Two-thread approaches, where the frame-presentation (to GPU) thread is higher priority than the rendering loop, aka a precise busyloop. (Timer to slightly prior + then busyloop rest of the way, then present, then flush). https://www.pouet.net/topic.php?which=11422&page=1 ... I guided both RTSS implement Scanline Sync, and Special K implement Latent Sync, but this is actually a slightly easier timing feat than that.

Obviously, we cannot always control when GPU presents the final frames, especially since GPUs will often have major contention (e.g. rendering a frame for longer than a single subframe -- aind GPUs aren't always able to efficiently deliver frames on time -- but hardware-based flips can help with that provided you have an high priority frame-presentation thread higher than the rendering threads (game) & processing thread (CRT filter).

I understand if these are advaned stuff far beyond your plans, but I thought I'd add this detail, since it's a big challenge to prioritize the frames.

I'll continue the discussion on Discord.

@nuninho1980
Copy link

nuninho1980 commented Sep 1, 2025

Welcome. I received new ViewSonic XG2431 monitor (you too) on past Friday and 1 day later, I tested it. :)

NOTICE! BFI SW affects any LCD strobed monitor (or XG2431/XG270 only?) at strobe (BFI HW - eg: ULMB or PureXP...) enabled. ;)

@mdrejhon
Copy link

mdrejhon commented Sep 2, 2025

Welcome. I received new ViewSonic XG2431 monitor (you too) on past Friday and 1 day later, I tested it. :)

NOTICE! BFI SW affects any LCD strobed monitor (or XG2431/XG270 only?) at strobe (BFI HW - eg: ULMB or PureXP...) enabled. I think we blame likely abnormally and randomly few freezes per minute or per 10~15 seconds of flickering issue on "DesktopBFI" app or "ShaderGlass" app with "BFI-sample" for burn-in issue. ;)

My CRT simulator has an LCD saver algorithm built into it.
I have the same algorithm enabled by default at https://beta.testufo.com/crt

@nuninho1980
Copy link

nuninho1980 commented Sep 2, 2025

My CRT simulator has an LCD saver algorithm built into it. I have the same algorithm enabled by default at https://beta.testufo.com/crt

I deleted "abnormally and randomly few freezes per minute or per 10~15 seconds of flickering issue[/b] on "DesktopBFI" app or "ShaderGlass" app with "BFI-sample" for burn-in issue" because of no any freeze of flickering on WinUAE emulator with BFI SW enabled and minutes later I got still burn-in again. I apologize you. :)

But if LCD monitor/TV has IPS panel, we do not use BFI-SW for avoid any burn-in while you may use BFI-SW on TN panel.

I request you (or ViewSonic) should work new firmware to 50Hz be added for PureXP.

@mdrejhon
Copy link

mdrejhon commented Sep 3, 2025

But if LCD monitor/TV has IPS panel, we do not use BFI-SW for avoid any burn-in while you may use BFI-SW on TN pane

It has a SAFE IPS LCD BFI ALGORITHM

I know how to do a custom BFI/CRT algorithm that has NO BURN IN FOR LCDs, regardless of IPS, TN, or VA LCDs.

There's no burn-in with my custom LCD Saver algorithm. I explain an LCD-friendly software BFI algorithm.

SAFE LCD BFI ALGORITHM: https://forums.blurbusters.com/viewtopic.php?t=7539

Hardware strobing is superior for a lot of things, but sometimes software BFI is useful for multiple reasons:

  • CRT does rolling scan, reduced flicker for those who hate 60Hz squarewave strobing
  • Convering 120Hz hardware strobe to 60Hz hardware strobe
  • Not all displays can do 60Hz hardware strobing.
  • CRT 60Hz simulation flickers a lot less than backlight strobing 60Hz

Some people prefer hardware strobing, and other people prefer software strobing.

My custom "safe BFI LCD" algorithm with no burn in, is already built into the Blur Busters CRT Simulator. Instead of dropping frames or using odd-Hz divisors, it uses a slow 0.001Hz slew (some displays need 0.01Hz), which is why a few people sometimes report a slow rolling bar if you haven't calibrated your gamma.

"Right Tool For Right Job"

@nuninho1980
Copy link

nuninho1980 commented Sep 3, 2025

It has a SAFE IPS LCD BFI ALGORITHM

Ok. But I don't deserve this, if safe BFI is softer flicker.

-- Can you work well new firmware of XG2431 to add 50Hz for PureXP?

@nuninho1980
Copy link

@mdrejhon: If you fail to work well new firmware of XG2431 to 50Hz added for PureXP, I'll return new monitor until september, 12th. You must reply URGENTLY me due to this date of return expiration!

@mdrejhon
Copy link

mdrejhon commented Sep 4, 2025

<OFFTOPIC>

Courtesy help:

@mdrejhon: If you fail to work well new firmware of XG2431 to 50Hz added for PureXP, I'll return new monitor until september, 12th. You must reply URGENTLY me due to this date of return expiration!

The refresh rate range of PureXP is from 60Hz to 240Hz. ViewSonic makes final decision on refresh rate range for strobing. I was unable to successfully convince ViewSonic to add 50Hz PAL strobing.

I apologize, but I tried my best to convince ViewSonic. It's beyond my control, I'm sorry.

I tried many times, you are not the first person to request PAL strobing.

It was still a giant miracle Blur Busters convinced ViewSonic to even support 60 Hz strobing. All the other strobing technologies do not even get as low as 60 Hz (DyAc, ULMB, ELMB, etc). I tried my best, but many manufacturers get complaints about flickering screen, from inexperienced people.

WORKAROUND: You can still combine software BFI and hardware strobing, to see what looks like low-Hz hardware strobing. XG2431 strobing can still be useful for 50Hz PAL strobing, if you combine both software BFI and hardware BFI simultaneously.

  1. Switch to 100Hz
  2. Turn software BFI on in RetroArch or supported software
  3. Enjoy 50Hz PAL strobing

The software BFI converts 100Hz strobing to defacto 50Hz strobing.

Please be noted though:

  1. RetroArch only has LCD Saver mode for CRT simulator
  2. RetroArch does not have LCD Saver for BFI mode
  3. You can still turn off PureXP and use CRT simulator.

You can still turn off hardware-based strobing (ULMB, ELMB, PureXP, VRB, etc). And instead switch to CRT simulator while running at 200Hz. You can get 50Hz PAL with CRT simulator at 75% blur reduction. The more Hz the better. 240Hz gives you better CRT 50Hz beam simulator than 144Hz does, since you can use 4 subframes. More subframes = more blur reduction in software.

With the CRT electron beam simulator, 1000Hz OLED is the future, with "Bring Your Own Algorithm" in 100% software-based motion blur reduction. But it means software such as ShaderGlass becomes mandatory, with a lot of computing power, to do it without erratic flickers. Problem is that software blur reduction can flicker a bit. It will take time for software to become mature. Rolling scan (beam simulation) has less flicker than hardware based strobing.

So you have multiple choices of still getting the XG2431 blur busting:

  1. You can combine hardware strobing and software BFI to get access to lower-Hz strobing (it's like the strobing equivalent of Low Framerate Compensation, e.g. 50Hz or 60Hz strobing)
  2. If you switch from BFI to CRT instead, then it's recommended to turn off hardware strobing (sometimes they may work together)
  3. With hardware strobing off, and using CRT simulator to reduce flicker.
  4. CRT simulator only: 240Hz with GAIN_VS_BLUR 0.25 will give you better result than CRT simulation on 144Hz LCD with hardware strobing turned off.
  5. Not all software has a LCD Saver mode with BFI or with CRT. Only some software do.

However, yes, you do have limitations. You don't have access to easy 50 Hz PAL hardware strobing without help from software (simultaneously using software BFI to convert 100 Hz PureXP to 50 Hz PureXP). If that's a mandatory requirement, then you should return the monitor. But remember, to get familiar with the benefits too.

Please remember I tried my best with ViewSonic. They make final decision on refresh rate range supported by hardware strobing. And how big a miracle I convinced them to do better than ULMB, ELMB, DyAc, etc...

Hope this helps!

HOW TO REPLY: Please use a different venue to contact me about ViewSonic monitor specific issues, let's keep this github entry for ShaderGlass. You can email me at mark [at] blurbusters [dot] com.

</OFFTOPIC>

@nuninho1980
Copy link

nuninho1980 commented Sep 4, 2025

@mdrejhon Thank you. I watch any DVB-T channel (Portugal - 50Hz signal) on VLC media player. Does ShaderGlass have new safe BFI SW? Or any new other BFI tool?

@mdrejhon
Copy link

mdrejhon commented Sep 4, 2025

@mdrejhon Thank you. I watch any DVB-T channel (Portugal - 50Hz signal) on VLC media player. Does ShaderGlass have new safe BFI SW? Or any new other BFI tool?

You can try this:

  1. Use ShaderGlass with VLC
  2. Set scan direction to 0, and subframes to 4
  3. Set XG2431 at 200Hz
  4. Turn on PureXP and use maximum blur reduction.
  5. Use Brightness vs Blur of 0.25

It won't work perfectly because CRT wasn't designed to be BFI, but it does closely emulate BFI (in a safe way) when scan direction is 0 and you use very low numbers (e.g. 0.25) for brightness-vs-blur.

IMHO, the experience will be much better with ShaderGlass on VLC on a 240Hz+ OLED.

To other readers: Has anyone tested ShaderGlass with VLC? The tricky part is synchronizing the frames with the CRT simulation. e.g. 24fps movies at 72Hz, or 60fps video at 240Hz, or 50fps video at 200Hz, etc. -- but there are a lot of configuration tricks available, just a question of how things are tweaked -- or how things are automated by ShaderGlass

@nuninho1980
Copy link

nuninho1980 commented Sep 5, 2025

@mdrejhon Brightness vs Blur on ShaderGlass? I can't find this because on alpha3... Maybe rest shaders (eg: EGA...) in library are deleted. On release of ShaderGlass... but no BFI shader. Or what other app?

@mausimus
Copy link
Owner Author

mausimus commented Sep 5, 2025

@nuninho1980

Brightness vs Blur on ShaderGlass? I can't find this because on alpha3... Maybe rest shaders (eg: EGA...) in library are deleted. On release of ShaderGlass... but no BFI shader. Or what other app?

In ShaderGlass alpha while on crt-beam-simulator go Shader -> Parameters, the setting is called Brightness vs Clarity

@nuninho1980
Copy link

nuninho1980 commented Sep 5, 2025

Thank you. I'll try bright-clarity... But... for BFI-simple or CRT beam simulator:
at 100Hz host (sub-frame 2 to 50Hz guest): almost zero freezes of flickering and single-image (puresmooth motion) - GOOD.
at 200Hz host (sub-frame 4 to same Hz guest): average or many freezes of flickering and double-image - BAD. :(

Oh! I've CPU Intel i7-12700KF@stock, 2x16GB DDR4-3600MHz and GPU GeForce RTX 4090@stock running Windows 10 x64 22H2.

@mausimus
Copy link
Owner Author

mausimus commented Sep 5, 2025

@nuninho1980 Hm your GPU should be able to handle it no problem, it might be Windows 10 holding you back (sorry I don't make the rules). Were you able to disable HAGS or use Process Lasso to increase CPU/GPU priorities (instructions in the alpha discussion page)?

Edit: also try using Window Input, it's bit more performant (instr on alpha page).

@nuninho1980
Copy link

nuninho1980 commented Sep 5, 2025

I tried to disable HAGS, to reboot PC and to increase the priority from "normal" to "high" for ShaderGlass but still randomly freezes of flickering.

At 200Hz, we get double-image on UFO test with ShaderGlass (SG) using but single-image without SG using.
While at 100Hz, we get single-image with or without SG using.

@nuninho1980
Copy link

nuninho1980 commented Sep 9, 2025

Hello!! 4 days later... :D

On ShaderGlass alpha3:

  • 3 or more sub-frames for ... "CRT beam simulator" shader can't get single-image except 2.
  • But 2 or 3 or more sub-frames for "BFI-sample" shader can get single-image. Almost zero freezes of flickering during ~30 seconds at 3 sub-frames (to 50Hz guest) at 150Hz host but average or many freezes of flickering during 30 seconds. 150Hz divided by 3 is for safe BFI. :)

@nuninho1980
Copy link

Hello. 2 weeks later...

New NVIDIA Studio v581.29 driver (before Studio v580.97) reduced much, much randomly freezes of flickering for "120-safe-BFI", for "120-smart-BFI" and for "CRT beam simulator". This driver is very probable. BFI-types and "CRT beam simulator" shaders get single-strobe 😁🥰 but except BFI-simple gets only abnormally double-image since that new driver.

Best regards. 😉

@Raduq91
Copy link

Raduq91 commented Oct 13, 2025

Some info about sleep(amd mwaitx; intel umwait) instruction from rpcs3 video https://youtu.be/3dkN-6TJNHs?t=342
Maybe this can help with better sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants