Skip to content

Commit 0d79c21

Browse files
committed
Merge branch 'master' of https://github.com/fuzun/strobe-api
2 parents dd4b4b4 + 6ae86ce commit 0d79c21

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

README.md

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,65 @@
11

2-
# StrobeAPI (Work in Progress)
3-
strobe-api is a software based strobe (a motion blur elimination method) library written in C++.
4-
It is currently a dirty C port and is in work in progress status and not ready for production uses.
52

6-
### Example Run
3+
4+
# StrobeAPI
5+
**StrobeAPI** or **strobe-api** is a simple software based strobe (a motion blur elimination method) library written in C++. It uses "*black frame insertion*" technique.
6+
7+
Online demo for motion blur elimination through black frame insertion / replacement method can be found here: https://www.testufo.com/blackframes
8+
9+
Black frame insertion technique **greatly reduces motion blur** which is extremely important in modern video games. However it has some disadvantages such as reduced 'effective' fps and brightness. For example, least aggressive mode causes effective fps to drop to half and it also causes 35~% brightness reduction. StrobeAPI provides almost all necessary information regarding its side effects.
10+
11+
With this method, moving objects can get tracked much more easily. For example, https://www.testufo.com/photo#photo=toronto-map.png&pps=960&pursuit=0&height=0 in this demo, moving texts in the map can not be easily read in LCD / LED screen without built-in strobe support. But with strobing, they can clearly get read.
12+
13+
## How To Use?
14+
To actually use StrobeAPI, you need to find an implementation for StrobeAPI. There is a simple but efficient implementation called "Strobe Core" which is already placed in the project source directory.
15+
StrobeAPI is a header-only library so it only consists of header files. test.cpp in the source directory is used for testing and not necessary for production. However, it can be kept without any problem as long as you don't include it in your project.
16+
To compile StrobeAPI, a modern C++ compiler should be enough.
17+
For integration examples, see test.cpp and Flappy-Bird-Qt project linked at the bottom of this page.
18+
19+
### Example
20+
21+
#include "strobe-core.h"
22+
...
23+
extern StrobeAPI *strobe;
24+
25+
int main()
26+
{
27+
...
28+
StrobeAPI *strobe = new StrobeCore(1 /* Strobe Mode 1: Applies RENDER - BLACK sequence */, 0 /* Interval for phase switching. Use only if image retention occurs */);
29+
...
30+
}
31+
32+
void SwapBuffers()
33+
{
34+
...
35+
// At the end of swap buffers code, a bool value coming from the strobe() function should be used to determine whether to show actual rendered frame or to show completely black frame
36+
// StrobeAPI automatically tracks previous and upcoming frames so do not intercept once it starts keep tracking.
37+
bool showRenderedFrame = strobe->strobe();
38+
39+
if(showRenderedFrame)
40+
// Do the stuff as usual
41+
else
42+
// Show black frame
43+
}
44+
void fps()
45+
{
46+
...
47+
strobe->setFPS(fps);
48+
}
49+
char * strobeDebugOutput()
50+
{
51+
return strobe->getDebugInformation();
52+
}
53+
54+
## Example Run
755
Strobe method = 2,
856
Strobe swap interval = 2,
957
Strobe cooldown delay = 3,
1058
FPS = randomly generated in the range of (99, 101)
1159

1260
![Simulation](https://vgy.me/An4BfE.png)
1361

14-
### Applications of StrobeAPI
62+
## Projects using StrobeAPI
1563
- https://github.com/fuzun/Flappy-Bird-Qt
1664
- https://github.com/fuzun/xash3d-strobe (Uses old C version of StrobeAPI)
1765

0 commit comments

Comments
 (0)