Another software strobing implementation on a 3D engine
Posted: 20 Jan 2018, 21:55
Hello,
If you do not know, there is a game engine called Xash3d and it is compatible with GoldSource. This means it can load the legacy Half-Life from 1998!
I have always been bothered with motion blur in fast paced games like Half-Life.
Since Gold Source is closed source and there is no way to implement software strobing into it without hacking driver or hooking, this will be an alternative to it.
What I want from you is checking if this is done right or not. I assume that you have Half-Life files in your computer so you can test this out.
Here is Xash3d engine: https://github.com/FWGS/xash3d
Here is the implementation: https://github.com/FWGS/xash3d/pull/343
If you do not know, there is a game engine called Xash3d and it is compatible with GoldSource. This means it can load the legacy Half-Life from 1998!
I have always been bothered with motion blur in fast paced games like Half-Life.
Since Gold Source is closed source and there is no way to implement software strobing into it without hacking driver or hooking, this will be an alternative to it.
What I want from you is checking if this is done right or not. I assume that you have Half-Life files in your computer so you can test this out.
Here is Xash3d engine: https://github.com/FWGS/xash3d
Here is the implementation: https://github.com/FWGS/xash3d/pull/343
- Just download the latest release from here: https://github.com/FWGS/xash3d/releases
- Extract the archive of this test build on top of that: https://transfer.sh/pDvAM/1025-01-27-xa ... d58ba72.7z
- Grab "valve" game folder from Half-Life folder in Steamapps/common (if you use steam) and copy or sym-link it to the folder that you have done the extractions.
- Start xash_sdl.exe with "-dev 5 log -console" parameters.
- Now, open console with ~ key and type "map c2a5a" or "map c1a0" (whatever map you want. C1A0 is good for testing text readability as it contains texts and c2a5a is good for testing brightness reduction and flickering).
- Make sure that vsync is enabled by typing gl_swapinterval 1. And turn off fps capping by typing fps_max 0.
- Turn on fps counter by typing cl_showfps 1.
- Finally turn on strobing with command "r_strobe <int>".
Any feedback will be appreciated!Purpose
Provides motion clarity by eliminating motion blur on high frequency monitors.
How
Replaces certain amount of consequent frames with black frames. This makes a scanning effect like CRT monitors.
Usage
Set r_strobe cvar to the black frame insertion interval (black frame count) you want (ideal values for 144hz monitors are probably -2, -1 = 1, 2, 3) . Frame display interval can be changed with gl_swapInterval cvar. Use cl_showfps 1 to see the actual / effective fps (displayed non-black frame count in 1 second).
Note that V-Sync must be active to enable this! (gl_swapInterval != 0)Issues
- If r_strobe is positive, some rendered frames will be replaced with black frame
For example result of r_strobe = 3 will be: black-black-black-normal-black-black-black-normal-black-black-black-normal- If r_strobe is negative, the procedure will be the opposite.
For example result of r_strobe = -4 will be: normal-normal-normal-normal-black-normal-normal-normal-normal-black
- Actual brightness gets reduced to half (and perceived brightness will be lowered but not as much as actual brightness) if r_strobe is set to 1 more if >1 less if <-1. This can be corrected somehow by altering gamma and brightness I believe. Because this is just like pulse width modulation synchronized to v-sync frames. And there are several methods to overcome PWM brightness issue. Implementing adaptive version of this is on todo list.
- FPS will always be lowered. Actual or effective FPS (frames that are not black) gets reduced to half if r_strobe is set to 1 or -1 more if >1 less if <-1 .
- This will trigger epileptic attacks on epileptic patients.
- Even on 144hz monitors, flickering may happen.
- Perceived picture quality will be worse. Much worse on IPS, VA or slow TN panels.
- Frames that will be black are rendered for no rational reason. TODO: Consider vsync timings and do not render the supposed black frame at all.
- Ghosting effect may increase.