Closed fuzun closed 6 years ago
Great, I will review it ASAP.
In maintenance... Will be reopened.
@a1batross - Take a look. OOP in C :) I hope you like macros.
I could not do some of your suggestions yet, but will try to do.
Well... I think I need to write something like contributing recommendations.
https://github.com/FWGS/xash3d/blob/master/CONTRIBUTING.md
Oops. I forgot about it.
Just comment here, when it will be ready.
I also will merge it for upcoming code base sync with Xash3D 1.0.
@a1batross Will FPS be global ? You have mentioned about flag operations, does version 1.0 contain new macros for that purpose ? And I have used some reserved keywords like "this" thinking it would not matter since it is a c file and therefore must be treated as c code, should I revert it to _this ?
Also will white color be added to the color table? I think it can be added after the "default" color (+1 increased array size).
in cl_view.c V_PostRender function, this part can be modified:
// if ( STROBE_TEMPLATE )
// STROBE_TEMPLATE->STROBE_IMPL_FUNC_DEBUGHANDLER( &STROBE_TEMPLATE );
if ( STROBE_CORE )
STROBE_CORE->STROBE_IMPL_FUNC_DEBUGHANDLER( &STROBE_CORE );
Debug handling function (printing informative strobe debugging text output from StrobeAPI) of your Strobe implementation can be called here.
in gl_rmain.c R_EndFrame function, this part can be modified:
// StrobeAPI.Invoker( STROBE_INVOKE(STROBE_TEMPLATE) ); StrobeAPI.Invoker( STROBE_INVOKE(STROBE_CORE) );
These variables are common in all StrobeAPI implementations because they are defined in StrobeAPI. In future these variables should be defined in implementations instead of StrobeAPI.
Good. I will test it ASAP and merge for old engine. New engine isn't ready for public and things may change, but I hope new engine will support strobing too.
I have a question, though. Will strobing help to defeat motion blur at 60 Hz? I got a new device recently, it's 60 Hz but too blurry.
I never intended to make this C89 compatible but for some reason compiler that Travis using can not compile if variables are defined in for statements due to "C89 compatibility". It does not need variables to be defined at start of a block.
I have a 60 hz screen and I am not satisfied with the strobing performance. Because even with the least aggressive strobe method (1 or -1), effective fps drops to 60/2 = 30 fps and frequency of signal drops to 30 hz. I find 30 fps/hz to be not enough for games xash3d support. r_strobe -2 method makes effective fps 40 but signal frequency (I call it PWM simulation) drops to 20 hz (60 * 1/3). I think at 20 hz it should not be even called as "strobing".
When I overclock the screen to 75 hz, strobing does not become annoying. So I think 75hz might be bare minimum for strobing.
I have another 60 hz screen that I overclocked it to 108 hz. Strobing helps too much for eliminating motion blur however that screen has only 220 cd/m2 peak brightness and even with least aggressive strobe method, screen becomes too dark. It also had image retention problem but it is fixed with r_strobe_swapinterval setting thanks to @mdrejhon .
And the last monitor I tested strobing is 144 hz. It has built-in hardware strobing so effective fps does not drop. The game is playable even with aggressive strobe methods like r_strobe = 2, 3 or -2 . I think that performance of software strobe method is like 30-35% of the built in hardware strobing.
There is an utility called CRU (Custom resolution utility) for overclocking monitors. I suggest you to try it.
As for this pull request, there are a few things that need to be corrected. They are not critical so you can merge it in my opinion. When I have time I will try to update it.
Pull request for the v1: https://github.com/FWGS/xash3d/pull/343 Discussion: https://forums.blurbusters.com/viewtopic.php?f=7&t=3815
News (v3):
News (v2):
Todo:
Move "Strobe" to separate files.Sample screenshot from the debug mode: https://camo.githubusercontent.com/081e3641e118be7554e42f54149dc9ce5c862724/68747470733a2f2f7667792e6d652f54646634675a2e706e67
This pull request will be edited and updated! It stands for review now.(9.03.2018)