Skip to content

Commit 53a8f8d

Browse files
committed
New Json descriptor for dSight with correct distortion.
Switched order of code in VRHead to fix distortion. Updated VRDisplayTracked prefab in OSVRDemo.unity
1 parent 279e0ed commit 53a8f8d

3 files changed

Lines changed: 113 additions & 73 deletions

File tree

OSVR-Unity/Assets/OSVRUnity/Displays/Sensics_dSight_landscape.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
"pitch_tilt": 0
1414
},
1515
"resolutions": [
16-
{
17-
"width": 1920,
18-
"height": 1080,
19-
"video_inputs": 2,
20-
"display_mode": "full_screen"
21-
},
2216
{
2317
"width": 1920,
2418
"height": 1080,
@@ -27,9 +21,9 @@
2721
}
2822
],
2923
"distortion": {
30-
"k1_red": 0,
31-
"k1_green": 0,
32-
"k1_blue": 0
24+
"k1_red": 0.5,
25+
"k1_green": 0.5,
26+
"k1_blue": 0.5
3327
},
3428
"rendering": {
3529
"right_roll": 0,
@@ -42,4 +36,4 @@
4236
}
4337
]
4438
}
45-
}
39+
}

OSVR-Unity/Assets/OSVRUnity/Sample/Demo/Scenes/OSVRDemo.unity

Lines changed: 103 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ NavMeshSettings:
7373
minRegionArea: 2
7474
widthInaccuracy: 16.666666
7575
heightInaccuracy: 10
76+
tileSizeHint: 0
7677
m_NavMesh: {fileID: 0}
7778
--- !u!1 &53051538
7879
GameObject:
@@ -308,11 +309,12 @@ MeshFilter:
308309
GameObject:
309310
m_ObjectHideFlags: 0
310311
m_PrefabParentObject: {fileID: 131732, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
311-
m_PrefabInternal: {fileID: 898916388}
312+
m_PrefabInternal: {fileID: 0}
312313
serializedVersion: 4
313314
m_Component:
314315
- 4: {fileID: 256429047}
315316
- 114: {fileID: 256429048}
317+
- 20: {fileID: 256429049}
316318
m_Layer: 0
317319
m_Name: RightEye
318320
m_TagString: Untagged
@@ -324,7 +326,7 @@ GameObject:
324326
Transform:
325327
m_ObjectHideFlags: 0
326328
m_PrefabParentObject: {fileID: 431732, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
327-
m_PrefabInternal: {fileID: 898916388}
329+
m_PrefabInternal: {fileID: 0}
328330
m_GameObject: {fileID: 256429046}
329331
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
330332
m_LocalPosition: {x: 0, y: 0, z: 0}
@@ -337,7 +339,7 @@ MonoBehaviour:
337339
m_ObjectHideFlags: 0
338340
m_PrefabParentObject: {fileID: 11431730, guid: bcbb49b5078d05d498ef83a6373ba939,
339341
type: 2}
340-
m_PrefabInternal: {fileID: 898916388}
342+
m_PrefabInternal: {fileID: 0}
341343
m_GameObject: {fileID: 256429046}
342344
m_Enabled: 1
343345
m_EditorHideFlags: 0
@@ -346,6 +348,39 @@ MonoBehaviour:
346348
m_EditorClassIdentifier:
347349
eye: 1
348350
cachedTransform: {fileID: 0}
351+
--- !u!20 &256429049
352+
Camera:
353+
m_ObjectHideFlags: 0
354+
m_PrefabParentObject: {fileID: 2017596, guid: bcbb49b5078d05d498ef83a6373ba939,
355+
type: 2}
356+
m_PrefabInternal: {fileID: 0}
357+
m_GameObject: {fileID: 256429046}
358+
m_Enabled: 1
359+
serializedVersion: 2
360+
m_ClearFlags: 1
361+
m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438}
362+
m_NormalizedViewPortRect:
363+
serializedVersion: 2
364+
x: 0
365+
y: 0
366+
width: 1
367+
height: 1
368+
near clip plane: .300000012
369+
far clip plane: 1000
370+
field of view: 60
371+
orthographic: 0
372+
orthographic size: 5
373+
m_Depth: 0
374+
m_CullingMask:
375+
serializedVersion: 2
376+
m_Bits: 4294967295
377+
m_RenderingPath: -1
378+
m_TargetTexture: {fileID: 0}
379+
m_TargetDisplay: 0
380+
m_HDR: 0
381+
m_OcclusionCulling: 1
382+
m_StereoConvergence: 10
383+
m_StereoSeparation: .0219999999
349384
--- !u!1001 &259186078
350385
Prefab:
351386
m_ObjectHideFlags: 0
@@ -1207,50 +1242,6 @@ Transform:
12071242
- {fileID: 1796457542}
12081243
m_Father: {fileID: 0}
12091244
m_RootOrder: 1
1210-
--- !u!1001 &898916388
1211-
Prefab:
1212-
m_ObjectHideFlags: 0
1213-
serializedVersion: 2
1214-
m_Modification:
1215-
m_TransformParent: {fileID: 1855890387}
1216-
m_Modifications:
1217-
- target: {fileID: 431736, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1218-
propertyPath: m_LocalPosition.x
1219-
value: 0
1220-
objectReference: {fileID: 0}
1221-
- target: {fileID: 431736, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1222-
propertyPath: m_LocalPosition.y
1223-
value: 0
1224-
objectReference: {fileID: 0}
1225-
- target: {fileID: 431736, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1226-
propertyPath: m_LocalPosition.z
1227-
value: 0
1228-
objectReference: {fileID: 0}
1229-
- target: {fileID: 431736, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1230-
propertyPath: m_LocalRotation.x
1231-
value: 0
1232-
objectReference: {fileID: 0}
1233-
- target: {fileID: 431736, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1234-
propertyPath: m_LocalRotation.y
1235-
value: 0
1236-
objectReference: {fileID: 0}
1237-
- target: {fileID: 431736, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1238-
propertyPath: m_LocalRotation.z
1239-
value: 0
1240-
objectReference: {fileID: 0}
1241-
- target: {fileID: 431736, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1242-
propertyPath: m_LocalRotation.w
1243-
value: 1
1244-
objectReference: {fileID: 0}
1245-
- target: {fileID: 431736, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1246-
propertyPath: m_RootOrder
1247-
value: 0
1248-
objectReference: {fileID: 0}
1249-
m_RemovedComponents: []
1250-
m_ParentPrefab: {fileID: 100100000, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1251-
m_RootGameObject: {fileID: 1818608091}
1252-
m_IsPrefabParent: 0
1253-
m_IsExploded: 1
12541245
--- !u!1 &914200232
12551246
GameObject:
12561247
m_ObjectHideFlags: 0
@@ -1779,11 +1770,12 @@ Transform:
17791770
GameObject:
17801771
m_ObjectHideFlags: 0
17811772
m_PrefabParentObject: {fileID: 131734, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1782-
m_PrefabInternal: {fileID: 898916388}
1773+
m_PrefabInternal: {fileID: 0}
17831774
serializedVersion: 4
17841775
m_Component:
17851776
- 4: {fileID: 1541774713}
17861777
- 114: {fileID: 1541774714}
1778+
- 20: {fileID: 1541774715}
17871779
m_Layer: 0
17881780
m_Name: LeftEye
17891781
m_TagString: Untagged
@@ -1795,7 +1787,7 @@ GameObject:
17951787
Transform:
17961788
m_ObjectHideFlags: 0
17971789
m_PrefabParentObject: {fileID: 431734, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
1798-
m_PrefabInternal: {fileID: 898916388}
1790+
m_PrefabInternal: {fileID: 0}
17991791
m_GameObject: {fileID: 1541774712}
18001792
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
18011793
m_LocalPosition: {x: 0, y: 0, z: 0}
@@ -1808,7 +1800,7 @@ MonoBehaviour:
18081800
m_ObjectHideFlags: 0
18091801
m_PrefabParentObject: {fileID: 11431732, guid: bcbb49b5078d05d498ef83a6373ba939,
18101802
type: 2}
1811-
m_PrefabInternal: {fileID: 898916388}
1803+
m_PrefabInternal: {fileID: 0}
18121804
m_GameObject: {fileID: 1541774712}
18131805
m_Enabled: 1
18141806
m_EditorHideFlags: 0
@@ -1817,6 +1809,39 @@ MonoBehaviour:
18171809
m_EditorClassIdentifier:
18181810
eye: 0
18191811
cachedTransform: {fileID: 0}
1812+
--- !u!20 &1541774715
1813+
Camera:
1814+
m_ObjectHideFlags: 0
1815+
m_PrefabParentObject: {fileID: 2017594, guid: bcbb49b5078d05d498ef83a6373ba939,
1816+
type: 2}
1817+
m_PrefabInternal: {fileID: 0}
1818+
m_GameObject: {fileID: 1541774712}
1819+
m_Enabled: 1
1820+
serializedVersion: 2
1821+
m_ClearFlags: 1
1822+
m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438}
1823+
m_NormalizedViewPortRect:
1824+
serializedVersion: 2
1825+
x: 0
1826+
y: 0
1827+
width: 1
1828+
height: 1
1829+
near clip plane: .300000012
1830+
far clip plane: 1000
1831+
field of view: 60
1832+
orthographic: 0
1833+
orthographic size: 5
1834+
m_Depth: 0
1835+
m_CullingMask:
1836+
serializedVersion: 2
1837+
m_Bits: 4294967295
1838+
m_RenderingPath: -1
1839+
m_TargetTexture: {fileID: 0}
1840+
m_TargetDisplay: 0
1841+
m_HDR: 0
1842+
m_OcclusionCulling: 1
1843+
m_StereoConvergence: 10
1844+
m_StereoSeparation: .0219999999
18201845
--- !u!1 &1542126324
18211846
GameObject:
18221847
m_ObjectHideFlags: 0
@@ -2455,7 +2480,7 @@ MonoBehaviour:
24552480
GameObject:
24562481
m_ObjectHideFlags: 0
24572482
m_PrefabParentObject: {fileID: 131736, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
2458-
m_PrefabInternal: {fileID: 898916388}
2483+
m_PrefabInternal: {fileID: 0}
24592484
serializedVersion: 4
24602485
m_Component:
24612486
- 4: {fileID: 1818608092}
@@ -2464,6 +2489,7 @@ GameObject:
24642489
- 114: {fileID: 1818608094}
24652490
- 114: {fileID: 1818608093}
24662491
- 114: {fileID: 1818608097}
2492+
- 114: {fileID: 1818608098}
24672493
m_Layer: 0
24682494
m_Name: VRDisplayTracked
24692495
m_TagString: Untagged
@@ -2475,7 +2501,7 @@ GameObject:
24752501
Transform:
24762502
m_ObjectHideFlags: 0
24772503
m_PrefabParentObject: {fileID: 431736, guid: bcbb49b5078d05d498ef83a6373ba939, type: 2}
2478-
m_PrefabInternal: {fileID: 898916388}
2504+
m_PrefabInternal: {fileID: 0}
24792505
m_GameObject: {fileID: 1818608091}
24802506
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
24812507
m_LocalPosition: {x: 0, y: 0, z: 0}
@@ -2490,7 +2516,7 @@ MonoBehaviour:
24902516
m_ObjectHideFlags: 0
24912517
m_PrefabParentObject: {fileID: 11431736, guid: bcbb49b5078d05d498ef83a6373ba939,
24922518
type: 2}
2493-
m_PrefabInternal: {fileID: 898916388}
2519+
m_PrefabInternal: {fileID: 0}
24942520
m_GameObject: {fileID: 1818608091}
24952521
m_Enabled: 1
24962522
m_EditorHideFlags: 0
@@ -2503,7 +2529,7 @@ MonoBehaviour:
25032529
m_ObjectHideFlags: 0
25042530
m_PrefabParentObject: {fileID: 11431734, guid: bcbb49b5078d05d498ef83a6373ba939,
25052531
type: 2}
2506-
m_PrefabInternal: {fileID: 898916388}
2532+
m_PrefabInternal: {fileID: 0}
25072533
m_GameObject: {fileID: 1818608091}
25082534
m_Enabled: 1
25092535
m_EditorHideFlags: 0
@@ -2518,15 +2544,15 @@ AudioListener:
25182544
m_ObjectHideFlags: 0
25192545
m_PrefabParentObject: {fileID: 8131736, guid: bcbb49b5078d05d498ef83a6373ba939,
25202546
type: 2}
2521-
m_PrefabInternal: {fileID: 898916388}
2547+
m_PrefabInternal: {fileID: 0}
25222548
m_GameObject: {fileID: 1818608091}
25232549
m_Enabled: 1
25242550
--- !u!20 &1818608096
25252551
Camera:
25262552
m_ObjectHideFlags: 0
25272553
m_PrefabParentObject: {fileID: 2031736, guid: bcbb49b5078d05d498ef83a6373ba939,
25282554
type: 2}
2529-
m_PrefabInternal: {fileID: 898916388}
2555+
m_PrefabInternal: {fileID: 0}
25302556
m_GameObject: {fileID: 1818608091}
25312557
m_Enabled: 1
25322558
serializedVersion: 2
@@ -2538,7 +2564,7 @@ Camera:
25382564
y: 0
25392565
width: 1
25402566
height: 1
2541-
near clip plane: .300000012
2567+
near clip plane: .00999999978
25422568
far clip plane: 1000
25432569
field of view: 60
25442570
orthographic: 0
@@ -2559,14 +2585,33 @@ MonoBehaviour:
25592585
m_ObjectHideFlags: 0
25602586
m_PrefabParentObject: {fileID: 11400556, guid: bcbb49b5078d05d498ef83a6373ba939,
25612587
type: 2}
2562-
m_PrefabInternal: {fileID: 898916388}
2588+
m_PrefabInternal: {fileID: 0}
25632589
m_GameObject: {fileID: 1818608091}
25642590
m_Enabled: 1
25652591
m_EditorHideFlags: 0
25662592
m_Script: {fileID: 11500000, guid: a288e4aec9950634b83d232abc73d1bb, type: 3}
25672593
m_Name:
25682594
m_EditorClassIdentifier:
25692595
JsonDescriptorFile: {fileID: 4900000, guid: 903a53a7997a82c42b329c472b623a4e, type: 3}
2596+
--- !u!114 &1818608098
2597+
MonoBehaviour:
2598+
m_ObjectHideFlags: 0
2599+
m_PrefabParentObject: {fileID: 11417594, guid: bcbb49b5078d05d498ef83a6373ba939,
2600+
type: 2}
2601+
m_PrefabInternal: {fileID: 0}
2602+
m_GameObject: {fileID: 1818608091}
2603+
m_Enabled: 1
2604+
m_EditorHideFlags: 0
2605+
m_Script: {fileID: 11500000, guid: db80e57e78593b64384f21c9a3022b68, type: 3}
2606+
m_Name:
2607+
m_EditorClassIdentifier:
2608+
k1Red: 0
2609+
k1Green: 0
2610+
k1Blue: 0
2611+
fullCenter: {x: .5, y: .5}
2612+
leftCenter: {x: .5, y: .5}
2613+
rightCenter: {x: .5, y: .5}
2614+
distortionShader: {fileID: 4800000, guid: 1dffc394b375bda49bb119de26c0bb35, type: 3}
25702615
--- !u!1 &1850521407
25712616
GameObject:
25722617
m_ObjectHideFlags: 0

OSVR-Unity/Assets/OSVRUnity/src/VRHead.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ void Start()
6060
{
6161
Init();
6262
CatalogEyes();
63+
_distortionEffect = GetComponent<OsvrDistortion>();
64+
if (_distortionEffect != null)
65+
{
66+
_distortionEffect.enabled = (viewMode == ViewMode.mono);
67+
}
6368
GetDeviceDescription();
6469
MatchEyes(); //copy camera properties to each eye
6570
//rotate each eye based on overlap percent, must do this after match eyes
@@ -68,11 +73,7 @@ void Start()
6873
SetEyeRotation(_deviceDescriptor.OverlapPercent, _deviceDescriptor.MonocularHorizontal);
6974
SetEyeRoll(_deviceDescriptor.LeftRoll, _deviceDescriptor.RightRoll);
7075
}
71-
_distortionEffect = GetComponent<OsvrDistortion>();
72-
if(_distortionEffect != null)
73-
{
74-
_distortionEffect.enabled = (viewMode == ViewMode.mono);
75-
}
76+
7677

7778

7879
}

0 commit comments

Comments
 (0)