aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 68e4c5a7eed34b9825bd7ace149debe9d7ac4861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
A virtual reality video player for Linux running X11, based on Valve's openvr `hellovr_opengl` sample code: https://github.com/ValveSoftware/openvr/tree/master/samples
Still early in development, not very user friendly.

Currently only works with stereo video when used for vr videos, but if the vr video player is launched with the `--plane` option then you can view
the video as a regular video in vr without depth (like a cinema).

# Building
vr video player can be built by running `./build.sh` or by using [sibs](https://github.com/DEC05EBA/sibs) or if you are running Arch Linux, then you can find it on aur under the name vr-video-player-git (`yay -S vr-video-player-git`).
Dependencies needed when building using `build.sh`: `glm, glew, sdl2, openvr, libx11 and libxcomposite`.

# How to use
Install xdotool and launch a video in a video player (I recommend mpv) and fullscreen it or resize it to fit your monitor for best quality and then,

if you want to watch 180 degree stereoscopic videos then run:
```
./vr-video-player $(xdotool selectwindow)
```
and click on your video player.

if you want to watch side-by-side stereoscopic videos or games (flat) then run:
```
./vr-video-player --flat $(xdotool selectwindow)`
```
and click on your video player.

if the side-by-side video is mirrored so that the left side is on the right side of the video, then run:
```
./vr-video-player --flat --right-left $(xdotool selectwindow)
```
and click on your video player.

if you want to watch a regular non-stereoscopic video, then run:
```
./vr-video-player --plane $(xdotool selectwindow)
```
and click on your video player.

The video might not be in front of you, so to move the video in front of you, you can pull the trigger on the vr controller or press the "W" key while the vr-video-player is focused or press the select/back button on an xbox controller while the application is focused. You can also send the SIGUSR1 signal to the application, using the following command:
```
killall -USR1 vr-video-player`
```

You can launch vr-video-player without any arguments to show a list of all arguments.

Note: If the cursor position is weird and does not match what you are seeing in stereoscopic vr mode, then try running the vr video player with the --cursor-wrap option:

--cursor-wrap and --no-cursor-wrap changes the behavior of the cursor in steroscopic mode. Usually in games the game view is mirrored but the cursor is not and the center of the
game which is normally at the center moves to 1/4 and 3/4 of the window. With --cursor-wrap, the cursor position in VR will match the real position of the
cursor relative to the window and with --no-cursor-wrap the cursor will match the position of the cursor as the game sees it.

Note: --cursor-scale is set to 0 by default in 180 degrees stereoscopic mode and --no-cursor-wrap is set by default in --flat mode.

# Games
This vr video player can also be used to play games in VR to to get a 3D effect, and even for games that don't support VR.\
For games such as Trine that have built-in side-by-side view, you can launch it with proton and there is a launch option for side-by-side view. Select this and when the game launches, get the X11 window id of the game
and launch vr video player with the `--flat` option.\
For games that do not have built-in side-by-side view, you can use [ReShade](https://reshade.me/) (or [vkBasalt](https://github.com/DadSchoorse/vkBasalt) for linux native games) and [SuperDepth3D_VR.fx](https://github.com/BlueSkyDefender/Depth3D) effect with proton. This will make the game render with side-by-side view and you can then get the X11 window id of the game and launch vr video player with the `--flat` option. The game you are playing might require settings to be changed manually in ReShade for SuperDepth3D_VR to make it look better.

# Images
`images/arrow.png` is from the adwaita project and it's licensed under Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of the license, visit http://creativecommons.org/licenses/by-sa/3.0/.