Skip to content

Commit fdaffb7

Browse files
committed
updated readmes
1 parent 1f0800b commit fdaffb7

File tree

2 files changed

+118
-4
lines changed

2 files changed

+118
-4
lines changed

OSVR-Unity/README.md

+117-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,124 @@ Examples for buttons and analog triggers are included in the `minigame` scene.
3131

3232
Paths for these callbacks that provide useful information can be found in the main OSVR-Core documentation on the "Writing a client application" page.
3333

34+
### Rendering
35+
The optimal path is to use OSVR-Unity with a direct-mode enabled config file. **OSVRDemo.unity** and **OSVRDemo2.unity** are simple scenes which demonstrate how to use the OSVR prefabs without harnessing Unity's built-in VR SDK.
36+
**OSVR-UnityVR-Demo.unity** is a scene with a prefab which uses Unity's native VR support and benefits from optimizations like single-pass rendering.
37+
38+
If a RenderManager configuration is not provided, the plugin will fall back to a more primitive rendering path.
39+
3440
### Other interaction
3541
Any other interaction with the OSVR framework should go directly through the Managed-OSVR (.NET) wrapper without any Unity-specific adaptations. See that source for examples of button and analog callbacks, as well as display parameter access (ideally used to set up the display properly). In terms of API, the Managed-OSVR API is effectively a direct translation of the C++ wrappers of OSVR `ClientKit`, so please see the main OSVR-Core client documentation for more information.
3642

3743
### Execution
38-
A standalone player built for Windows may end up needing the `-adapter N` argument, where `N` is a Direct3D display adapter, to put the rendered output on the HMD display.
44+
A standalone player built for Windows may end up needing the `-adapter N` argument, where `N` is a Direct3D display adapter, to put the rendered output on the HMD display. This is usually not necessary.
45+
46+
## Building for Android
47+
The libraries required for building for Android are included in the OSVR-Unity source. These will eventually be migrated out of the OSVR-Unity repo when the CI build is updated and will copy them for us when the unitypackage is created.
48+
49+
### Server Config File
50+
Copy a file named **osvr_server_config.json** to _/sdcard/osvr/_.
51+
The contents of osvr_server_config.json should match your display. Here is a server config for a Samsung Galaxy S6:
52+
<details>
53+
<summary>Click to expand osvr_server_config.json</summary>
54+
55+
```json
56+
{
57+
"display": {
58+
"meta": {
59+
"schemaVersion": 1
60+
},
61+
"hmd": {
62+
"device": {
63+
"vendor": "Samsung",
64+
"model": "Galaxy S6",
65+
"num_displays": 1,
66+
"Version": "1.1",
67+
"Note": "Samsung Galaxy S6"
68+
},
69+
"field_of_view": {
70+
"monocular_horizontal": 90,
71+
"monocular_vertical": 101.25,
72+
"overlap_percent": 100,
73+
"pitch_tilt": 0
74+
},
75+
"resolutions": [
76+
{
77+
"width": 2560,
78+
"height": 1440,
79+
"video_inputs": 1,
80+
"display_mode": "horz_side_by_side",
81+
"swap_eyes": 0
82+
}
83+
],
84+
"distortion": {
85+
"distance_scale_x": 1,
86+
"distance_scale_y": 1,
87+
"polynomial_coeffs_red": [0, 1, -1.74, 5.15, -1.27, -2.23 ],
88+
"polynomial_coeffs_green": [0, 1, -1.74, 5.15, -1.27, -2.23 ],
89+
"polynomial_coeffs_blue": [0, 1, -1.74, 5.15, -1.27, -2.23 ]
90+
},
91+
"rendering": {
92+
"right_roll": 0,
93+
"left_roll": 0
94+
},
95+
"eyes": [
96+
{
97+
"center_proj_x": 0.5,
98+
"center_proj_y": 0.5,
99+
"rotate_180": 0
100+
},
101+
{
102+
"center_proj_x": 0.5,
103+
"center_proj_y": 0.5,
104+
"rotate_180": 0
105+
}
106+
]
107+
}
108+
},
109+
"renderManagerConfig": {
110+
"meta": {
111+
"schemaVersion": 1
112+
},
113+
"renderManagerConfig": {
114+
"directModeEnabled": false,
115+
"directDisplayIndex": 0,
116+
"directHighPriorityEnabled": false,
117+
"numBuffers": 2,
118+
"verticalSyncEnabled": false,
119+
"verticalSyncBlockRenderingEnabled": false,
120+
"renderOverfillFactor": 1.0,
121+
"window": {
122+
"title": "OSVR",
123+
"fullScreenEnabled": false,
124+
"xPosition": 0,
125+
"yPosition": 0
126+
},
127+
"display": {
128+
"rotation": 0,
129+
"bitsPerColor": 8
130+
},
131+
"timeWarp": {
132+
"enabled": true,
133+
"asynchronous": false,
134+
"maxMsBeforeVSync": 5
135+
}
136+
}
137+
},
138+
"plugins": [
139+
"com_osvr_android_sensorTracker"
140+
]
141+
}
142+
```
143+
</details>
144+
145+
### Server Autostart
146+
The current default path relies on the server autostart feature. Check the "server autotostart" flag on the ClientKit prefab for Android builds. See the OSVR-UnityVR-Android-Demo.unity scene. If the server fails to start, you'll see a black screen, have no tracking, or the application could crash.
147+
148+
### Disable Mirror Mode
149+
If you target is a phone display and not an HMD, you'll want to disable the OsvrMirrorDisplay component in your scene.
150+
151+
### Player Settings
152+
Note that you'll need Write Access to the External SD Card, and Internet Access set to Required. The following player settings have been tested to work with Unity 2017.1.0f3 and Unity 5.6.1f1:
153+
154+
![OSVR-Unity Android Player Settings](https://github.com/OSVR/OSVR-Unity/blob/master/images/unity_2017_android_playersettings?raw=true)

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ The Unity integration is based on the [Managed-OSVR][] .NET binding for OSVR, wh
1515
## OSVR-RenderManager Support
1616
OSVR-Unity uses the OSVR-RenderManager library for direct-mode rendering, lens correction, timewarp, etc.. [OSVR-RenderManager](https://github.com/sensics/OSVR-RenderManager) is a separate, Unity-independent project that is used in other applications/engines. The project which bridges between OSVR-Unity and OSVR-RenderManger is [OSVR-Unity-Rendering](https://github.com/OSVR/OSVR-Unity-Rendering), which uses the Unity low-level [native plugin interface](https://docs.unity3d.com/Manual/NativePluginInterface.html).
1717

18-
These libraries are copied over to the Plugins directory in our CI build, and are not included in the source.
19-
20-
## Android
18+
These libraries are copied over to the Plugins directory in our CI build, and are not included in the source.
2119

2220
## OSVR Unity Integration
2321
[Step-by-step getting started guide](https://github.com/OSVR/OSVR-Unity/blob/master/GettingStarted.md)

0 commit comments

Comments
 (0)